last day (15 days later) » 

7:39 PM
1
A: How can I pass data with URLs to ui-sref?

pankajparkarThere is already logged issue in ui-router Github, you could found it here In order to solve this you need to add this code inside your config which will take care of encoding and decoding of url. you could override the built-in string type (which is performing the slash encoding) by regis...

 
Yes, it must be the way to go. I've been fiddling with this in a plunk for sometime now, but no joy. Could you please make the plunk work, I've wasted too much time on it already; I've given up on this, but I'm still curious to know what I got wrong: plnkr.co/edit/XWndxl?p=preview
 
@Manube added the plunkr plnkr.co/edit/XWndxl?p=preview, you made mistake here added $urlMatcherFactory.type("myType", { instead of $urlMatcherFactory.type("string", {
 
Is it working on your side? does it display #/file/html/hero-sidebar.html when you hover the 'html/hero-sidebar.html' link?
 
@Manube ya on hover url it is showing the encoded url, but in browser url bar it accurate as we want
 
'myType' was not a mistake, the name can be customised, as explained here: github.com/angular-ui/ui-router/issues/…. I'm afraid you forgot to save your work in the plunk, as it is still the same I posted. The plunk was already working in the sense it displayed the view. However, the issue is in the name of the url, which still has %2F or %252F. And I think that when you hover the link, it should display the decoded url. How can you prove it works otherwise?
 
7:39 PM
@Manube I forgot to save the plunkr, you're right here is updated one plnkr.co/edit/TEPEAb?p=preview
 
sorry, but the plunk is not working. Proof: change pattern to pattern: /whatever/: the link still displays, still with %2F; in fact, with string it is not using the $urlMatcher; now use url: '/file/{path:myType}' and it uses custom $urlMatcher, but still issues with %2F: plnkr.co/edit/veTxYh?p=preview
 
Could you please look at this github.com/angular-ui/ui-router/issues/… , I don't understand why you are not able to see the difference
check the url
from where I referred
and did you checked my udpated plunkr in answer
u there
 
yes I checked the plunk you saved. I think $urlMatcher is circumvented. Replace pattern by /whatever/: it still follows the link, but should not
bad luck: Plnkr.co is DOWN right now :(
 
wait
a minute
 
in fact, when $urlMatcher is used (like it was in the original, with myType) and you change the pattern to something unmatchable, like /whatever/, the link is replaced by simple text
plunker.co is working again!
 
7:52 PM
yes
Plunkr.co may be busy in migration it to angular
 
and please don't take this discussion personally: I just need your help to try and understand this issue, and I would love to upvote your answer
 
they had developed good site, plunker.co is good example of angular..which tells it can also use for making simulator
yes I'm not taking it seriously bro
 
they use angular to develop plunkr.co? I didn't know that
 
check in console..they have awesome structure
on front end
of angular
You really don't know...? or just pulling my leg .. lol
:D
sorry not in console..by inspect element..element tab..in chrome browser
 
no, I didn't know. That's what I like about SO, you learn so many things!
 
7:57 PM
yeahhh...I also learnt so many thing from here
did you checked? what i told..
 
anyway, with this $urlMatcher issue: yes, it is the way to go, but I think we are still missing something
 
ohh..can you tell me what are we missing here?
on hover url is shown as encoded? do you think we are missing this?
 
did you change the pattern to something unmatchable, like /whatever/ in your plunk?
 
ok let me try
yes
I did
and my url is replaced with /whatever
 
if the $urlMatcher is used, then the link should be simple text, not a link
 
8:00 PM
on browswer url bar
 
no, I mean in the $urlMatcher: pattern: /whatever/
 
i tried this url: '/file/path:/whatever/'
is it correct
or should i try something else
 
no, not correct. Check this: plnkr.co/edit/XWndxl?p=preview
 
you should see the link as plain text, not clickable, not working.
now replace pattern: /whatever/ bypattern: /[^/]*/ and the link is back on: it proves $urlMatcher is used. Working path is this, as you can see in plunk: .state('file', {
url: '/file/{path:myType}'
templateUrl: 'file.html'
but even when the link is working and using the custom $urlMatcher, there is still some ugly %2F or %522F in the path :(
I will gladly resume this chat at another time, as I must now attend to family matters. See you!
 
8:21 PM
yeah
you are trying url: '/file/{path:myType}' and I'm trying 'url: '/file/*path' which is working fine for me..take a closer look at mine plunkr
 

last day (15 days later) »