<span class="button-icon pull-left" ><i class="ti ti-plus" ng-click="itemOpen()"></i></span>
This is my Html Code.
$scope.itemOpen=function()
{
return $location.path('/ConsultationParameterMaster');
};
This is my script. And the error is. $location.path is not a function
You need to inject $location in your controller if you are going to do this. where you are missing 'focus' as a parameter
app.controller('sampleController', ['$scope','$http','$location', function($scope,$http,$location) {
$scope.itemOpen=function()
{
return $location.path('/ConsultationParameterMaster');
};
}
EDIT:
According to your comment,You need to arrange the dependencies,
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)
app.controller('ctrl', ['$http','$scope','$location', function($http,$scope,$location) {
$scope.itemOpen=function()
{
return $location.path('/ConsultationParameterMaster');
};
}
<span class="button-icon pull-left" ><i class="ti ti-plus" ng-click="itemOpen()"></i></span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With