angularjs - How to detect url in Angular JS? -


i have chat in angular js. need open dialog window if user put url as: /chat/dialog/12

how can it?

use $location. $location.path() returns current url

var url = $location.path(); if(url==='/chat/dialog/12'){ //do code here } 

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? -