winter
winter

Reputation: 144

How to use 2 index.htmls in an angularjs application?

In an angularjs application, is it possible to use a different (index.html?) for login page and use another index.html page for rest of the pages in the application?

Upvotes: 0

Views: 46

Answers (2)

Durgpal Singh
Durgpal Singh

Reputation: 11953

also you can use ng-show and ng-hide

<div ng-show="userLoggedIn">
   <login page html>
</div>

<div ng-hide="!userLoggedIn">
   <regular page html>
</div>

Upvotes: 0

David H.
David H.

Reputation: 507

It is possible, however you can also use ng-if on the login html code and the regular html code:

<div ng-if="userLoggedIn">
   <login page html>
</div>

<div ng-if="!userLoggedIn">
   <regular page html>
</div>

Which will show one of the divs according to what is set as $scope.userLoggedIn in your main controller.

Upvotes: 1

Related Questions