AngularJS 4 Tutorial: 06. Generating services using Angular CLI

Опубликовано: 05 Февраль 2018
на канале: StepByStep
246
1

In this video we will discuss generating services using the Angular CLI.

To generate a service we use
ng generate service serviceName or ng g s serviceName

To register our service with the AppModule
ng generate service serviceName -module=app.module

The above command can also be rewritten using shortcut
ng g s serviceName -m=app.module

The above command generates the service and the spec file. If you do not want the spec file, simply set --spec=false
ng g s serviceName -d --spec=false

If you want a folder of for a service set --flat option to false as shown below.
ng g s student -d --spec=false --flat=false

In our next video we will discuss generating modules in Angular Cli.

Click Subscribe for More Videos...


На этой странице сайта вы можете посмотреть видео онлайн AngularJS 4 Tutorial: 06. Generating services using Angular CLI длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь StepByStep 05 Февраль 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 246 раз и оно понравилось 1 зрителям. Приятного просмотра!