I created a function on my controller in angularjs which look likes this
$scope.pload = function () {
$http.get('/WebServices/manageuser.asmx/showdatamanageuser', {
}).then(function (response) {
$scope.getdata = response.data;
console.log($scope.getdata);
});
}
and i want to call this function after insert,delete and page load, so i called the function like this
<script type="text/javascript">
var app = angular.module("myApp", ["ngStorage"]);
app.controller("myCtrl", function ($scope, $http, $interval, $localStorage, $sessionStorage, $window) {
var filename = undefined;
var file = undefined;
var filepath = undefined;
//showing table
$scope.pload();
the error i am getting is
TypeError: $scope.pload is not a function
at new <anonymous> (VM190 ManageUser:427)
at Object.invoke (angular.js:4842)
at R.instance (angular.js:10695)
at n (angular.js:9572)
at g (angular.js:8881)
at angular.js:8746
at angular.js:1843
at m.$eval (angular.js:17972)
at m.$apply (angular.js:18072)
at angular.js:1841
what is wrong here?
"call"the function from?