AngularJS RESTful params -


is possible use angularjs $http service parameterize restful url? example:

var url = '/api/countries/:countryid/states'  var getstates = function (countryid) {     $http.get(url, { countryid: countryid }).then(); }; 

every combination try ends using query string, not want.

i don't think possible in way describe.

in end you'll want go following:

var getstates = function (countryid) {     var url = '/api/countries/'+countryid+'/states'     $http.get(url, {}).then(); }; 

though if has better solution i'd love hear :)


Comments

Popular posts from this blog

python - Mongodb How to add addtional information when aggregating? -

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

java - Incorrect order of records in M-M relationship in hibernate -