Mahedi Sabuj
Mahedi Sabuj

Reputation: 2944

AngularJS Multiple View

Default View

<html>
  <head>
    //angular source
  </head>
  <body ng-app="angular">
    //header
    // login and register button 
    <div ng-view></div>
    // footer
  </body>
</html>

Profile View

<html>
  <head>
    //angular source
   </head>
   <body ng-app="angular">
     //header and menu
     <div ng-view></div>
     // footer
    </body>
</html>

When i try to log in, i am in Default View. After successfully logged in, i want to move a new view (Profile View). Is it possible in angularJS ??

Upvotes: 0

Views: 143

Answers (2)

user4294688
user4294688

Reputation:

one thing you can do make user of AngularJS Routes

http://tutorials.jenkov.com/angularjs/routes.html

just go through with this tutorial you will get some hint

Upvotes: 0

antimatter
antimatter

Reputation: 3480

So the difference is in the header and menu? Why not just use something like ng-show to conditionally check which view you're in (using $location) and update like that.

Or if you really want to keep those pages separate, you could create new static content that loads a different angular app that's 'logged in'. But I don't think this is good design.

Upvotes: 1

Related Questions