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

Define factory method in angularjs.

0 Answers  


what is directive and mention what are the different types of directive?

0 Answers  


Explain what is the difference between link and compile in angular.js?

0 Answers  


What is ivy compiler?

0 Answers  


How to setup and create angular services?

0 Answers  






How to create a service in angular?

0 Answers  


What is injectors?

0 Answers  


Is it possible to have two ng-app directives for a single angular application?

0 Answers  


What is the use of ngfor directive in angular?

0 Answers  


What are the two ways to use currency filters?

0 Answers  


What is transclusion in angularjs?

0 Answers  


What is $interval service in AngularJS?

0 Answers  


Categories