AngularJS Developer Question:
Download Questions PDF

Explain me what is scope hierarchy in AngularJS?


Scopes are controllers specific. If we define nested controllers then child controller will inherit the scope of its parent controller.

var mainApp = angular.module("mainApp", []);

mainApp.controller("shapeController", function($scope) {
$scope.message = "In shape controller";
$scope.type = "Shape";

mainApp.controller("circleController", function($scope) {
$scope.message = "In circle controller";

Download AngularJS Developer Interview Questions And Answers PDF

Previous QuestionNext Question
What is ng-init directive?Explain with options on page load how you can initialize a select box?