1var myApp = angular.module('scopeInheritance', []);
2myApp.controller('MainController', ['$scope', function($scope) {
3 $scope.timeOfDay = 'morning';
4 $scope.name = 'Nikki';
5}]);
6myApp.controller('ChildController', ['$scope', function($scope) {
7 $scope.name = 'Mattie';
8}]);
9myApp.controller('GrandChildController', ['$scope', function($scope) {
10 $scope.timeOfDay = 'evening';
11 $scope.name = 'Gingerbread Baby';
12}]);
1
2myApp.controller('ChildController', ['$scope', function($scope) {
3 $scope.name = 'Mattie';
4}]);
5myApp.controller('GrandChildController', ['$scope', function($scope) {
6 $scope.timeOfDay = 'evening';
7 $scope.name = 'Gingerbread Baby';
8}]);