Angular cli generate directives, pipes and routing guards
In this video we will discuss generating directives, pipes and routing guards using the Angular CLI.
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1
Generating directives, pipes, routing guards and other angular features is very similar to generating component and services. We discussed generating components and services using the Angular CLI in our previous videos in this course.
To generate a directive use
ng generate directive directiveName OR ng g d directiveName
To generate a pipe use
ng generate pipe pipeName OR ng g p pipeName
To generate a routing guard use
ng generate guard guardName OR ng g g guardName
Please note : When you try to generate a directive, pipe or a component, and if you have multiple modules in your angular project you may get the following error
More than one module matches. Use skip-import option to skip importing the component into the closest module.
The reason we are getting this error is we have more than one module in our angular project, so Angular CLI does not know with which module the newly generated directive, pipe or component should be registered. So we have 2 options here.
1. Use --skip-import option to tell Angular CLI not to import and register the generated component, directive or pipe
ng g d directiveName --skip-import -d
2. Use --module option or it's alias -m to tell Angular CLI the module with which we want our newly generated component, directive or pipe should be registered.
ng g d directiveName -m=app.module -d
If you have just one module in your Angular project, then you wouldn't get this error, as the angular cli will automatically import and register the newly generated component, directive or pipe with that one existing module.
When genearting certain angular features like services or routing guards, you will not get this error, even when you have multiple modules in your project, because by default, Angular CLI does not try to import and register these features.
Please note that we can always use the following options along with ng generate command to customise the generation of directives, pipes and routing guards using the Angular CLI.
flat - Specifies if a dedicated folder should be created
module - Specifies the module with which the newly generated angular feature should be rigstered
spec - Specifies if a spec file should be generated
Text version of the video
http://csharp-video-tutorials.blogspot.com/2017/10/angular-cli-generate-directives-pipes.html
Slides
http://csharp-video-tutorials.blogspot.com/2017/10/angular-cli-generate-directives-pipes_17.html
Angular CLI Tutorial
https://www.youtube.com/watch?v=rJ9o4TyhSuo&list=PL6n9fhu94yhWUcq5Pc16uf8YKXoZ87Vh_
Angular CLI Text articles & Slides
http://csharp-video-tutorials.blogspot.com/2017/10/angular-cli-tutorial-for-beginners.html
All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd
All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatArabic/playlists
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Angular cli generate directives, pipes and routing guards», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.