Comments Service
Let's add a service to add comments on the events and write unit tests for this service.
We'll cover the following...
Now that our event view is in place, we’re ready to start adding some additional functionality to this page in addition to the existing event details. The first feature we’ll add is the ability for users to post comments about an event. We’ll start by creating the service for comments.
First, create the service and its associated model.
ng g service services/comments/comments
ng g interface services/comments/comment
The first command
creates two files:
CREATE src/app/services/comments/comments.service.spec.ts
CREATE src/app/services/comments/comments.service.ts
The second command ng g interface services/comments/comment
creates one file:
CREATE src/app/services/comments/comment.ts
Below is the updated code after running the above commands.
your_API_key
Not Specified...
�PNG IHDR ?�~� pHYs ��~� fIDATH��WKLQ���̔�uG�� e�n�.6qcb�l?���D`�F#� Ku�F 1Qc� ��!���� ��C�P�|B?$���ܱ3����I&}��}�̽s�[*�ɀU�A� �K��yx�gY�Ajq��3L Š� ��˫�OD�4��3Ϗ:X�3��o�PJ�ğo#IH�a����,{>1/�2$�R AR]�)w��?�sZw^��q�Y�m_��e���r[8�^� �&p��-���A}c��- ������!����2_)E�)㊪j���v�m� �ZOi�g�nW�{<n8�P����o�=$8�K��9|$����@��v�P<�j�>�n.|�e2�a&�0aŸ����be�̀��C�fˤE%-{�ֺ��C��N��jXi�~c�C,t��T�����r �{� �L)s��V��6%�(�#ᤙ!�]��H�ҐH$R���^R�A�61(?Y舚�>���(Z����Qm�L2�K�ZIc�� ���̧�C��2!⅄ �(����"