I want genereate url in angular resource using FOSJSBundle.
This is the code that need FOSJSBundle to generate url:
Routing.generate('get_constructionprivateinformation_industrialists', {id: id}, false));
This is the service code that use resource:
services.factory('IndustrialistsFactory', function ($resource) {
return $resource(
'/app.php/api/v1/constructionprivateinformations/:id/industrialists',
{id: '@id'},
{
query: { method: 'GET', isArray: true },
create: { method: 'POST'}
}
)
});
This code works but I want generate url using FOSJSBundle, then If I do this code not works because Routing.generate have not access to id.
I proved this code but not works:
services.factory('IndustrialistsFactory', function ($resource) {
return $resource(
Routing.generate('get_constructionprivateinformation_industrialists', {id: id}),
{id: '@id'},
{
query: { method: 'GET', isArray: true },
create: { method: 'POST'}
}
)
});
What Can I do?
Thanks