i am creating an application with angularjs and nodejs.
how to authenticate and authorize user in angularjs. say for example before sending a template to the user i have to check whether the user has access to it or not.
And also is it possible to send some request to server instead of angular?
for eg if the user hits www.example.com/sample#/template1, then he will be shown with template1 with the help of angular routing,
$routeProvider.
when('/', {templateUrl: '/template1', controller: ctrl1}).
otherwise({redirectTo: '/invalid'});
instead of this that particular req has to be handled by node server.
app.get(/sample/template1)
// do the following
Thanks in advance