What are the directive scopes in AngularJs?

Three directive scopes are available in AngularJs.

They are:

  • Parent scope – Whatever change you make in your directive that comes from the parent scope, will also reflect in the parent scope, and it is also a default scope.
  • Child scope – It is a nested scope which inherits a property from the parent scope. Also if any properties and function on the scope are not connected with the parent scope directive, then a new child scope directive is created.
  • Isolated scope – It is reusable and is used when we build a self-contained directive. It is only used for private and internal use which means it does not contain any properties of the parent scope.

Leave a Reply

Your email address will not be published. Required fields are marked *