angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.85k stars 27.52k forks source link

Add function in $location which creates a link href given parameters #9182

Open sodacrackers opened 10 years ago

sodacrackers commented 10 years ago

I have a simple search app with URLs like: /search/?q=fish&p=2&l=30&cat=2,3,4. While I'm able to redirect using $location.path('/search/').search({q: 'fish', p:1 }); There's no output for links like above or, creating app links from input like {q: 'fish', p:1 }.

Please provide a getter like $location.createUrl([string, object]) so that I can create links in themeing, without knowing the current directory, if it's html5 or, having to add another function that makes URLs from an object.

wesleycho commented 10 years ago

Why would you want to have the urls hardcoded instead of using something like ngRoute or ui-router to handle the query param construction?

sodacrackers commented 9 years ago

Support middle-clicking or so themeing can use javascript to create proper application URLs.