======================Angular URL search ==========
$scope.getParameterByName = function(namesearch) {
var name = namesearch.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex
.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
};
if($scope.getParameterByName('src') )
{
alert($scope.getParameterByName('src'));
}
else if($scope.getParameterByName('cat') )
{
alert($scope.getParameterByName('cat'));
}
else if($scope.getParameterByName('type') )
{
alert($scope.getParameterByName('cat'));
}
else
{
alert("default");
}
$scope.getParameterByName = function(namesearch) {
var name = namesearch.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex
.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
};
if($scope.getParameterByName('src') )
{
alert($scope.getParameterByName('src'));
}
else if($scope.getParameterByName('cat') )
{
alert($scope.getParameterByName('cat'));
}
else if($scope.getParameterByName('type') )
{
alert($scope.getParameterByName('cat'));
}
else
{
alert("default");
}