由于某种原因,我的$ location对象在我的控制器中调用时没有路径功能。
有人有想法吗?
E:这里是控制器
erpmApp.controller('dashboardCtrl', ['$scope', '$http', '$parse','$swipe', '$location', '$rootScope', 'Page', 'Data', 'Config', function ($scope, $rootScope, $http, $parse, $swipe, $location, Page, Data, Config) {
Config.setHeadbarStatus(true);
Page.setTitle('ERP-Mobile');
$scope.dashboarddata = null;
$scope.redirect = function(url) {
console.log($location);
};
$scope.loadDashboard = function() {
if($scope.dashboarddata == null) {
Data.getDashboardMenuData().then(function(response){
$scope.dashboarddata = response;
});
}
};
}]);
答案 0 :(得分:0)
您的依赖项名称已混淆
['$scope', '$http', '$parse','$swipe', '$location', '$rootScope', 'Page', 'Data', 'Config', function(
$scope, $rootScope, $http, $parse, $swipe, $location, Page, Data, Config) {
这意味着,您认为$location
实际上是'$rootScope'