1

I have chat in Angular JS. I need to open dialog window if user put URL like as: /chat/dialog/12

How I can do it?

1
  • why you don't think of modal popup instead of window Commented May 12, 2015 at 11:10

1 Answer 1

1

Use $location. $location.path() returns the current URL

var url = $location.path();
if(url==='/chat/dialog/12'){
//do your code here
}
Sign up to request clarification or add additional context in comments.

2 Comments

But if instead /12 any number?
I don't know what your scenario is. Getting URL is in this way. Comparing the URL with some string you want is your logic. Do you want to compare only /chat/dialog/ ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.