In angular App, I have 2 pages, each of them for according to user's privileged level. for that how can I redirect templates from routerby using resolve or without?
what would be the correct way?
here is what I am looking for :
$routeProvider.when('/secretpage' , {
        templateUrl: null,        
        resolve:{
            "check":function(accessFac,$location){  
                if(accessFac.checkPermission()){    
//check if the user has permission -- This should happen before the page loads
return this.template: "templates/secretpage.html"
                } else {
                    this.template: "templates/secretlesspage.html"
                }
            }
        }
})