Login page in SPA’s (Angularjs)

Asked

Viewed 35 times

1

In the current scenario, I have an index.html that works as a kind of template. For example, in it I have a side menu, a toolbar at the top and, at the "center", a div (ng-view) to receive dynamic content.

The point is that the login screen has nothing to do with this "template". It has its own characteristics. In this case, what would be the best approach? I thought of some solutions, but I would like the opinion of someone more experienced with SPA’s.

  • 1

    I would particularly leave the index only with a ui-view central and controlled by states. So, after authenticating the user, you would have what is currently yours index and which contains the "frame" so to speak of its pages

  • Okay, that was my initial idea, really. What would the implementation look like? I mean, each of my dynamic pages (contact registration, for example) should contain its contents + what is now part of the template (sidebar, Toolbar, etc.) ?

  • 1

    Not exactly. You can have a ui-view within the other. You are working with ui-router?

  • I’m wearing 'ngRoute''.

  • 1

    Take a look this link with the differences between ui-router and ngRoute, the strongest difference for me is in the multiple views. Without them you won’t be able to do what I was describing here satisfactorily

  • Perfect! Exactly what I needed.

  • 1

    I’ll see if I can put an example in the answer, so you can see more or less how it looks

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.