How to create custom directives in AngularJS?



How to create custom directives in AngularJS?..

Answer / pankajbisane

Custom directives are used in AngularJS to extend the functionality of HTML. Custom directives are defined using "directive" function. A custom directive simply replaces the element for which it is activated. AngularJS application during bootstrap finds the matching elements and do one time activity using its compile() method of the custom directive then process the element using link() method of the custom directive based on the scope of the directive

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What do you understand by constants in angular?

0 Answers  


How can you differentiate between angular expressions and javascript expressions?

0 Answers  


How do you stop ng serve?

0 Answers  


What is lazy loading and why is it used for angular?

0 Answers  


What directives are used to show and hide HTML elements in AngularJS?

1 Answers  


What is isolate scope in angularjs?

0 Answers  


What would be a good use case for having your own routing module?

0 Answers  


What are isolated unit tests?

0 Answers  


What is angular 4 and why it is used?

0 Answers  


What is angular mainly used for?

0 Answers  


What is difference between component and module in angular?

0 Answers  


What are the services in angular js?

0 Answers  


Categories