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

How are the services injected to your application?

533


What is ngClass directive in AngularJS?

617


Which is the core module in angularjs?

553


What are the lifecycle hooks for components and directives?

553


What are differences between components and directives?

623


How do you use singleton pattern?

588


What does ‘ng-serve’ do?

594


Explain class and inheritance in js?

572


Explain filter filter?

600


What is the use of decorators in angular?

558


What is the difference between annotation and decorator in angular 2?

587


What are the differences between $resource and $http?

575


How will you implement internationalization in angularjs?

558


What is singleton pattern? How does angular use it?

602


Is wordpress a framework?

577