0

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 ??

Mahedi Sabuj
  • 2,894
  • 3
  • 14
  • 27

2 Answers2

1

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.

antimatter
  • 3,240
  • 2
  • 23
  • 34
  • I don't want to show visitors `using Firebug or etc` what `menu or something` they are getting after login. That's why i don't want to use `ng-show`. As you say, it is not possible to move one view to another. Is it ?? – Mahedi Sabuj Nov 29 '14 at 08:15
  • Oh, well you can use [ng-if] (https://docs.angularjs.org/api/ng/directive/ngIf) (and I think `ng-switch`), which won't render the menu at all if the condition is false (rather than merely hide it, like `ng-show` would): "If the expression is falsy then the element is removed from the DOM tree" – antimatter Nov 30 '14 at 01:26
0

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