How to create custom directives in AngularJS?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between factory service and provider in angularjs?

407


Explain component metadata?

440


What is a provider in angular?

412


Global variables in angularjs?

444


What companies are using angular?

395






What is main ts file?

407


How can someone make an ajax call using angularjs?

414


Is it a good or bad practice to use angular js together with jquery?

492


How to initiate variable in angularjs?

437


Why should use angular js?

443


Explain The Concept Of Scope Hierarchy? How Many Scopes Can An Application Have?

426


Is angular 7 released?

410


How do you identify a structural directive in html?

431


What is the difference between a module’s forroot() and fairchild() methods and why do you need it?

449


What is digest cycle?

445