1
Good evening, I’m having trouble making the login screen in my application
Index.html
<body>
<div ng-include"'dashboard.html'"></div>
<div ng-view></div>
</body>
If I put in the form login
within the index.html
will show everything together with the dashboard
and the ng-view
, and I want you to show only the screen of login
and when authenticating the user, redirect it to the dashboard
with the ng-view
NG-VIEW
angular.module("app").config(function($routeProvider){
$routeProvider.when("/Cliente", {
templateUrl:"Cliente.html",
controller :"ClienteController"
});
$routeProvider.when("/Corretor",{
templateUrl:"Corretor.html",
controller:"CorretorController"
});
$routeProvider.when("/NovoContrato",{
templateUrl:"NovoContrato.html",
controller:"ContratoController"
I could put the ng-view
within the dashboard
but then I’d have to duplicate the <HEAD>
of index
in dashboard
...
Someone would have another solution??
Can Dashboard.html only be viewed after logging in? If yes, you could create a login route and another one for Dashbord and remove include and leave only ng-view. To access the dashboar only with login, see how to do this using "resolve", see also on ui-route,
– Filipe Moraes
Dude I usually use the concept of master page. using the ui.router you can apply the same, so da to use a master p/ the system and separate login.
– Renan Degrandi