I have a route to receive one message and a service to request my API for this. But I need to pass the parameters from the URL to the service so that I can properly call the API. I canβt plunge into the head how to do it.
This is what I came up with. I missed what seemed to be inappropriate to this issue.
Thank you for your help!
Routing
myModule.config([ '$stateProvider', '$urlRouterProvider', '$locationProvider', function($stateProvider, $urlRouterProvider, $locationProvider) { $stateProvider .state('post', { url: '/posts/:hash_id/:slug', templateUrl: '/js/app/views/post.html', controller: 'PostCtrl', resolve: { postPromise: ['posts', function(posts, $stateParams){
Service
myModule.factory('posts', ['$http', 'auth', function($http, auth){ var o = { posts: [], post: {} }; o.getOne = function(params) {
source share