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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -