在这段代码中,控制器被提供的注入范围和rootScope,为何还未能与最后一行:如何在Angular中访问此rootScope?
的ReferenceError:$ rootscope没有定义
angular.module("myEntity").controller('productsCtrl', [
'$scope', 'MyAction', '$rootScope', function ($scope, MyAction, $rootScope) {
$scope.propertyValue = something;
$scope.canDoSomething = $rootscope.myRootScopeProperty = 1;
....
它是''''rootScope'''(大写字母S),你有一个错字。 – Dario