7

I'm working through this Angular authorization repo https://github.com/fnakstad/angular-client-side-auth and came across the line if (fromState.url === '^') and I have no clue what it means.

You can see it in context here https://github.com/fnakstad/angular-client-side-auth/blob/a65505880345abf487aa38c56f24fbf8ab8e12a0/client/js/app.js

To be clear, I'm asking what the caret symbol '^' means in this particular context.

Eric
  • 586
  • 1
  • 5
  • 19
  • 1
    You mean you don't know what `===` does? – Felix Kling Feb 17 '14 at 17:40
  • 1
    its probably matching the empty route case, ie what happens when someone goes to the root of your site by just typing in www.example.com. Generally this is the home page or index page. – agconti Feb 17 '14 at 17:41
  • possible duplicate of [Reference - What does this symbol mean in PHP?](http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php) – showdev Feb 17 '14 at 17:41
  • i can't find a carrot in the server code, which you think would emit it... – dandavis Feb 17 '14 at 17:41
  • 1
    are you asking for the difference between "===" and "==" ? – ashbuilds Feb 17 '14 at 17:41
  • 5
    I wonder if this is related: https://github.com/angular-ui/ui-router/wiki/URL-Routing#wiki-absolute-routes- – Ian Feb 17 '14 at 17:51
  • @Ian thanks! Submit your comment as an answer and I'll mark it correct :) – Eric Feb 17 '14 at 17:59
  • @PaulS. are you being serious? I was pretty sure it was about the absolute route that Ian posted – Eric Feb 17 '14 at 18:21
  • correct me if im wrong but i think it just checks if the state you came from is your parent. i.e if you have the following nested states: app ("/"), app.admin ("/admin"), if you change the url to /admin once you are in url: "/" than the event 'StateChangeStart' triggered and fromState.url should be "^". The equivilant syntax in Javascript '===' instead of '==' is basically a way to compare without conversion. – Lihai Sep 02 '15 at 19:39

0 Answers0