Get Url Parameter with Query String using angularjs
In this Post We Will Explain About is Get Url Parameter with Query String using angularjs With Example and Demo.
Welcome on infinityknow.com – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to web – How to access data from the url parameters in AngularJS
In this post we will show you Best way to implement How to get the url parameters using angularjs, hear for How to javascript – How to get the url parameters using angular js with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.
How to get the url parameters using angularjs
Using simple $location.search() we can easily steps to get the query parameter using Angularjs.here learn to “Get url parameter using angular js”.
[php]
//url
http://www.infinityknow.com/#/?liveusername=’liveclientname’&tocken=’tocken’
//Note ‘#/’
//In your simple controller using Angularjs
$location.search();
Result:
{
liveusername : ‘liveclientname’,
tocken:’tocken’
}
[/php]
Even we can try using Angularjs
[php]
$location.search().liveusername
$location.search().tocken
//we can simple write your own logic
if($location.search().liveusername && $location.search().tocken){
alert(do your logic);
}
[/php]
Check simple query parameter is existing using Angularjs
[php]
if($location.search().yourQueryData.indexOf(‘?’) > 0)
{
alert(query parameter existing);
}
else{
alert(query parameter no existing);
}
[/php]
I hope you have Got web – How to access data from the url parameters in AngularJS And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.