Structural directives are a powerful feature in Angular. They implement the logic to create embedded views. Embedded views are reusable view fragments which can be dynamically created and inserted into a component view. They are defined within a component template using . It is the ViewContainerRef API that is used to create, query and manipulate dynamic views. The main difference between structural directives and dynamic components is that structural directives only implement the logic for creating a view and let the user define the view. This makes structural directives a powerful tool for implementing generic and reusable functionalities. In this talk, we will look at TemplateRef (), ViewContainerRef (view containers), how to pass state to embedded views using the context object, how to access this state using template input variables, and the microsyntax for structural directives. We will use these building blocks to create a custom structural directive.
About Ashnita Bali
Ashnita believes in promoting community and diversity and organises Angular and WTM meetups for GDGReading. She is passionate about supporting self-learners and organises and mentors study groups for freeCodeCamp Reading. She also loves traveling, meeting people and the outdoors.
Follow us on twitter: @ngSpain
Official website: [ Ссылка ]
Ещё видео!