📜  范围和根范围之间的区别 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:49.944000             🧑  作者: Mango

代码示例2
angular.module('example', [])
  .controller('GreetController', ['$scope', '$rootScope',
    function($scope, $rootScope) {
      $scope.name = 'World';
      $rootScope.department = 'Angular';
    }
  ])
  .controller('ListController', ['$scope',
    function($scope) {
      $scope.names = ['Igor', 'Misko', 'Vojta'];
    }
  ]);