adding service using CLI

10 views
Skip to first unread message

Bakadiri Abdelouahab

unread,
May 14, 2018, 4:53:42 PM5/14/18
to Angular and AngularJS discussion
Hello; why when I write this code bellow , the service don't add to my app module?
thank you
Auto Generated Inline Image 1

Tito

unread,
May 14, 2018, 10:37:21 PM5/14/18
to Angular and AngularJS discussion
maybe 

ng g s services/api --module=app.module?

Sander Elias

unread,
May 14, 2018, 11:52:14 PM5/14/18
to Angular and AngularJS discussion
Hi Bakadiri,

From version 6 on, the way services are provided is changed. Services now use treeshakable tokens, and register themselves into a module or 'root'. you don't need to add them to a module anymore.

Regards
Sander
Reply all
Reply to author
Forward
0 new messages