$state.href() does not include path
See original GitHub issueMy Angular app resides at a path on my server, /app
, not the root /
path. Calling $state.href
does not seem to include the path name in its return value.
Example:
$state.href("doggy", { style: "raw" }, { absolute: true });
Results in:
http://localhost:8080/#/doggy?style=raw
Whereas really it should be:
http://localhost:8080/app/#/doggy?style=raw
Am I missing something obvious here or is this a bug?
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
AngularJS UI-Router : Get the absolute URL of the state with ...
To get the absolute URL you can then use: $state.href('user.home.view', {}, {absolute: true}); · To get the URL with the parameters in place...
Read more >Directives - UI-Router
A directive which links to a state (and optionally, parameters). When clicked, this directive activates the linked state with the supplied parameter values....
Read more >How can we specify no route path in UI-Router - Edureka
I'm having web page that contains all the links, but the problem is if the user attend to follow the unspecified path, How...
Read more >Easier AngularJS Routing with Angular UI Router
Does not allow you to pass around data during navigation. ... Notice that the element is updated to include an href attribute with...
Read more >Developer Guide: Using $location - AngularJS: API
All values that are passed to $location setter methods, path() , search() , hash() ... AngularJS also does not intercept and rewrite links...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve worked around with this:
var aboluteUrl = document.location.origin + document.location.pathname + $state.href(‘mystate’) ;
Try changing absolute: true to absolute: false. This worked for me.