0
I am working on a project.. but I need to do a validation taking the current url.. Ex:
If(url('/questions/ask')){
// Aqui vem minha lógica
}
How do I do this with Angularjs('I’m new at angular..') ?
Thank you.
0
I am working on a project.. but I need to do a validation taking the current url.. Ex:
If(url('/questions/ask')){
// Aqui vem minha lógica
}
How do I do this with Angularjs('I’m new at angular..') ?
Thank you.
1
You can and should do this using Javascript.
Just use the window.location.href
.
It will have return to the URL you are at the moment.
That way you can do:
if(window.location.href == 'www.google.com'){
//Sua lógica aqui
}
For more information about window.Location, see here.
Browser other questions tagged angularjs
You are not signed in. Login or sign up in order to post.
What validation?
– novic
of the brother url..
– wDrik
What kind of validation Brother?
– novic
Do you want to check the address bar URL or validate a URL that came from an INPUT? Please explain this right.
– Guilherme Nascimento
taking the current url... I was very explicit in the question
– wDrik