What is AngularJS directive?
Likewise, why do we use directives in AngularJS?
AngularJS directives allow us to literally "direct" AngularJS to associate user-defined behaviors with a DOM element - giving great flexibility in creating and using custom elements in Web applications. Whereas, Services are to serve.
In respect to this, what is restrict in AngularJS directive?
AngularJS Directive's restrict key defines how a directive can be used in HTML. A : Specifies that Directive will be used as an attribute, like <div item-widget></div>, as was done in last example. This is also the default behavior if restrict is not declared.
Scopes in AngularJS These objects, also known as scope in AngularJS terms, work as a glue between the view and other parts ( directives, controllers and services ) inside the AngularJS application. Whenever the AngularJS application is bootstrapped, a rootScope object is created.