AngularJS get with parameter -
actually not develop angularjs, somethimes seems me fight angular :-) therefore sorry question.
i have following code user rest service:
services.factory('getuserbyusernameservice', function($resource) { return $resource('users/finduserbyusername/:username',{username: 'admin'}); });
and invokation looks this:
function updateusercontroller($scope, getuserbyusernameservice) { $scope.finduser = function() { $scope.foundeduser = getuserbyusernameservice.get(); }
}
username path parameter. not know how set parameter get- invokation method (getuserbyusernameservice.get()) return $resource('... invokation. helping!
you can do:
$scope.foundeduser = getuserbyusernameservice.get({username:user});
in controller code
Comments
Post a Comment