What are different ways to invoke a directive?



What are different ways to invoke a directive?..

Answer / Atiya Baqai

Directives in AngularJS can be invoked in several ways:

1. Attribute Directives: They are bound to an HTML attribute and modify the behavior of an element or its contents. Example: ng-show, ng-click.
2. Class Directives: They are bound to a class name and modify the behavior of an element or its contents. Example: ngClass.
3. Element Directives: They are bound to an HTML tag and replace it with a custom template. Example: ng-repeat.
4. Component Directives: They are complex directives that can contain multiple templates, components, and services. They allow for creating reusable UI components. Example: Angular's built-in component directive.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

Is angular 7 is stable?

1 Answers  


How are you managing cookie in AngularJS

1 Answers   Virtusa,


What is module in angular?

1 Answers  


What are the key features/concepts of Angular.js?

1 Answers  


How do I get data from web api in angularjs 7?

1 Answers  


What does :host-context() pseudo-class selector target?

1 Answers  


Explain component life cycle in angular?

1 Answers  


How to update to angular 5?

1 Answers  


What is lazy loading in angular 2?

1 Answers  


What is the difference among "declarations", "providers" and "import" in ngmodule?

1 Answers  


Is mvc front end or backend?

1 Answers  


What is schema in angular?

1 Answers  


Categories