3

I have two page "Login" and "Dashboard". If user is unauthenticate login page will be loaded, after login success the page will be redirect to dashboard page.

In my scenario I use obfuscator for dashboard page, after user login the browser will received a secret key from server to decode. So I have to split my app to two page, please ignore the suggest combine them to single page.

I have create two index page, two app module but I do not known how to load index page base on authentication.

2 Answers 2

1

You can use ng-route or UI router in inorder to route to a different pages based on the token.

Here's a documentation link and an example.

1

Angularjs is usually used for single (!) page application so you may want to reconsider your architecture. However if you still want to redirect outside of the current Angularjs application you can use smth like below

window.location = "http://www.domain.com/dashboard"

Not the answer you're looking for? Browse other questions tagged or ask your own question.