filmov
tv
AngularJS Tutorial 20 - Controller As Syntax

Показать описание
In this video we have discussed about Controller As syntax in angular JS
In my previous video we have learnt about nested controller in that child controller will inherit the data from its parent scope.
When you bind the property on $scope in nested controller you will unexpected output
So everytime when you access property inside parent scope you have to access the property using $parent property in angularjs.
But this lead to again lot of confusion because with each level deep you need to add $parent for immediate parent. so in this case it is very difficult to remember the scope of controller
So to get rid from this issue you can create an alias of your controller so that wherever you want to access parent scope , all you need to use mention the alias name that will act like a object
So first rule to create Controller-As Syntax is you need to bind the properties of controller on this rather then $scope object.
});
parentController as parent
Visit my facebook page@
In my previous video we have learnt about nested controller in that child controller will inherit the data from its parent scope.
When you bind the property on $scope in nested controller you will unexpected output
So everytime when you access property inside parent scope you have to access the property using $parent property in angularjs.
But this lead to again lot of confusion because with each level deep you need to add $parent for immediate parent. so in this case it is very difficult to remember the scope of controller
So to get rid from this issue you can create an alias of your controller so that wherever you want to access parent scope , all you need to use mention the alias name that will act like a object
So first rule to create Controller-As Syntax is you need to bind the properties of controller on this rather then $scope object.
});
parentController as parent
Visit my facebook page@
AngularJS Tutorial 20 - Controller As Syntax
AngularJS Tutorial #9 - Controllers
AngularJS For Everyone Tutorial #20 - Creating A Basic Directive
AngularJS Tutorial 7- Controllers
AngularJS Tutorial 19- Nested Controllers
AngularJS Video Tutorials - How to use controller within AngularJS Routing configuration
AngularJS Tutorial for Beginners - 5 - Controllers
AngularJS For Everyone Tutorial #6 - Controller As Syntax
AngularJS Tutorial #01 How To Create , Use The Module And Controller And Link Them
AngularJS controller as syntax
Pass Data from Parent Controller to Child Controller Using $rootScope in AngularJS
AngularJs Tutorial 101. Creating an AngularJS Controllers with TypeScript Object Oriented Approach
AngularJS For Everyone Tutorial #18 - Defining Your Controller In UI Router
AngularJS Tutorial: Transclusion Scope and Custom data
AngularJS Tutorial
AngularJS Tutorial | Interpolation And Controllers
Angular JS full course for beginners- Registering the Controller and Module
AngularJs Expert. Route with controller [20]
AngularJS Tutorial 21- Routing
AngularJS Tutorial
AngularJS tutorial: recipe box
AngularJS - Filters
AngularJS - Post form data to server side MVC controller
AngularJS Tutorial for Beginners (Full Course)
Комментарии