Angular js scope: the child scope would inherit from the parent scope

http://docs.angularjs.org/#!/cookbook/deeplinking

 

Learn from this example, the child controller would inherit the function and properties from the parent controller.

 

The "person" attribute in declared in "AppCntl" which is the parent. But "WelcomeCntl" as a subcontroller can use it, provided that " $route.parent(this);" has added "AppCntl" as the parent controller.

 

 

你可能感兴趣的:(Angular)