<span class="button-icon pull-left" ><i class="ti ti-plus" ng-click="itemOpen()"></i></span>
这是我的 Html 代码。
$scope.itemOpen=function()
{
return $location.path('/ConsultationParameterMaster');
};
这是我的脚本。 错误是。 $location.path is not a function
最佳答案
如果你要这样做,你需要在你的 Controller 中注入(inject) $location 。您缺少“焦点”作为参数的地方
app.controller('sampleController', ['$scope','$http','$location', function($scope,$http,$location) {
$scope.itemOpen=function()
{
return $location.path('/ConsultationParameterMaster');
};
}
编辑:
根据您的意见,您需要安排依赖,
coreModule.registerController('MedicalRecordsController', ['$rootScope', '$scope', '$sessionStorage', 'Restangular', '$element', '$themeModule', '$filter', '$uibModal', 'gettext', 'focus', '$location', function ($rootScope, $scope, $sessionStorage, Restangular, $element, $themeModule, $filter, $uibModal, gettext,focus,$location)
关于javascript - TypeError : $location. 路径不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38823695/