javascript - TypeError: $location.path is not a function -


<span class="button-icon pull-left" ><i class="ti ti-plus" ng-click="itemopen()"></i></span> 

this html code.

 $scope.itemopen=function()          {              return $location.path('/consultationparametermaster');          }; 

this script. , error is. $location.path not function

you need inject $location in controller if going this. missing 'focus' parameter

app.controller('samplecontroller', ['$scope','$http','$location', function($scope,$http,$location) {  $scope.itemopen=function()          {              return $location.path('/consultationparametermaster');          }; } 

edit:

according comment,you need arrange 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) 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -