Skip to content Skip to sidebar Skip to footer

Angularjs Spring Mvc @requestparam

I'm newbie in Angularjs,The following Spring controller get object from database by id I want to get This id by @RequestParam using AngularJs ,I try the following code but get this

Solution 1:

You forgot to pass id to findOne as a function parameter:

findOne: function(id) {
        var promise = $http.get('app/rest/chartConfigs/getById',{params: {'id': id}}).
                        then(function  (response) {
            return response.data;
        });
        return promise;
    }

Post a Comment for "Angularjs Spring Mvc @requestparam"