例如这样app.controller('myCtrl', function($scope, $rootScope) { // 将$rootScope改成其他名字就不行了。 $scope.names = ["Emil", "Tobias", "Linus"]; $rootScope.lastname = "Refsnes";});angular是怎么知道我第二个参数需要$rootScope?
添加回答
举报
0/150
提交
取消