0

adminpage.html

<html><body ng-app = "myapp"
 <div data-ng-view/>
</body></html>

userpage.html

<html><body ng-app = "myapp"
 <div data-ng-view/>
</body></html>

After login, if you are admin, adminpage.html will be loaded. If you are normal user, userpage.html will be loaded. data-ng-view for adminpage.html is very different with userpage.html. How can I do that with angularjs, passportjs, expressjs?

laggingreflex
  • 32,948
  • 35
  • 141
  • 196
user3044147
  • 1,374
  • 5
  • 14
  • 23

1 Answers1

0

You should just have one index.html file that bootstraps your application and only one ng-view. Based on the role returned from your server-side authentication mechanism, you would then route the user to the appropriate route you set up with $routeProvider.

Loc Nguyen
  • 9,471
  • 5
  • 22
  • 27