I want to create a global function like:
function CheckAuthorization($window)
{
if($cookieStore.get('token')=='')
$window.location.href = '/login';
}
and call it everywhere. Is this possible? The above code is not working.
I want to create a global function like:
function CheckAuthorization($window)
{
if($cookieStore.get('token')=='')
$window.location.href = '/login';
}
and call it everywhere. Is this possible? The above code is not working.