javascript - Difference between $location.path("/home") and $location.$$path="/home" in angularjs -


i have login page , home page in sample poc.

when user completed signed in, have redirect home page login page.

i have tried below codes redirecting home page login page using angular.$location

code 1

 $location.path("/home"); 

this code working good.no issues.

code 2

$location.$$path="/home"; 

this code not working probably, because page redirected, url shown previous url,does not changed redirected url.

  • why happened?
  • what difference between code1 , code2

angular uses single dollar ($) of api methods, properties, , event names. methods considered "public" , safe use developers. documented , not change much, if change angular team tell it.

when see 2 dollars ($$) you're best off leaving alone. can of course use them way want (debugging use), shouldn't need to. if use them own purposes there's no guarantee there on next minor version update code becomes more brittle.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -