It is a shame... I couldn't find any 3rd module which does that. How people
are generating their links?
None of the answers covers all the url, for instance:
$routeProvider.when('/:lang/tv/:channelPid?', { templateUrl: 'tv/tv.html',
controller: 'TvController' });
*ChannelPid *is *optional*, so if I don't pass *channelPid *parameter, the
proposed function (answered at stackoverflow) will not replace it, and it
will generate a wrong link.
People can't possible be generating links manually, I mean, look at the
following route:
$routeProvider.when('/:lang/:catalog/:pid/:title?', { templateUrl:
'details/details.html', controller: 'DetailsController' });
There are a lot of things there...
I ruled out my own version, which is far from great...
Any updates? Any new lib for this?
On Tuesday, March 12, 2013 1:23:03 PM UTC-3, Andrej Slivko wrote:
>
> In .NET MVC there is @Url.Action()and in RoR there is url_for()
>
> I could not find similar url building helper in angularjs.
>
> I'm already providing everything that is needed to build url to
> $routeProvider so something like:$routeProvider.urlFor("MyCtrl", {id: 5})
> could
> be nice to have.
>
> My main goal here is to avoid hardcoded urls in views and other places
> and to avoid repeating url/routes patterns twice.
>
> What would be good solution for my goals?
>
>
> P.S. I asked same question in stackoverflow but didn't get answer yet.
> http://stackoverflow.com/questions/15324039/how-to-create-a-url-for-link-helper-in-angularjjs
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.