New Angular Router

Yet to view/analyse and try it..will let you know ASAP.

Source: http://www.jvandemo.com/a-10-minute-primer-to-the-new-angular-router/?utm_content=buffer3c864&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer

Advertisements

Restangular call service as query string parameters angularjs

How to call a service as query string(like shown below) parameters in angularjs??

/resource/subelement?query=param

Get to know what is restangular here

application-service.js:

var getDetails = function(application, location, product) {
return $q(function(resolve, reject){
var params = {
product: product,
location: location,
};

Restangular.one(‘servicename’).customPOST(application, “”, params, {}).then(function(response){
console.log(“servicename”, response);

resolve(response);
}, function(reason){
reject(‘Problem submitting the application. Reason: ‘ + reason);
});
});
};

Now in controller where ever you should call this getDetails method. Just add ApplicationService as dependency injection. Thats it, you can run your application and check response in console.log after service call.