top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the isolated scope in Angular.Js Directive ?

0 votes
414 views
What is the isolated scope in Angular.Js Directive ?
posted Dec 31, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Scope in AngularJS inherits from Parent Scope default. But, sometimes it is not required specially in the case of development of some common components. In this case directive should not read or write properties value in the parent scope by mistake. So, Isolated Scope came into picture.

Isolated scope does not prototypically inherit from the parent scope. It can access its parent scope through the $parent property. So, Directive has three options for isolating its scope from parent scope.
The following are the three options:
1) scope: false - It is default in Directive. It lets to reuse the scope from the place where the component is being used.

2) scope: true - It creates a child scope. This child scope prototypically inherits from the scope where the component is being used.

3) scope: {...} - It creates Isolates scope. It does not prototypically inherit from the scope where the component is being used.

Read More Here - https://www.c-sharpcorner.com/UploadFile/1c8574/isolated-scope/

answer Apr 30, 2018 by Kuldeep Apte
...