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

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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 ??
Oh, well you can use [ng-if] (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"
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.