MY App.JS
/**
>
> * Initialize Angular
>
> */
>
> 'use strict';
>
> var app = angular.module("stockvoip", [
>
> "ngCookies",
>
> "ngResource",
>
> "ngSanitize",
>
> "ngRoute",
>
> "stockvoip.controllers",
>
> "stockvoip.services"/*,
>
> "stockvoip.filters",
>
> "stockvoip.directives"*/
>
> ]);
>
>
>> app.config(['$routeProvider', '$locationProvider', function
>> ($routeProvider){
>
> $routeProvider.when("/", {
>
> templateUrl: '/views/user/login.html',
>
> controller: "UserController"
>
> })
>
> .when("/dashboard", {
>
> templateUrl: '/views/dashboard/dashboard.html',
>
> controller: "DashboardController"
>
> })
>
> $routeProvider.otherwise({redirectTo: "/"});
>
> }]);
>
>
>> app.run(function ($rootScope, $location) {
>
> $rootScope.$on("$routeChangeStart", function(event, nextRoute,
>> currentRoute) {
>
> if ($rootScope.SessionId == "" || $rootScope.SessionId == null) {
>
> if (nextRoute.templateUrl != "/views/user/login.html")
>
> $location.path("/");
>
> }
>
> });
>
> });
>
>
INDEX.HTML
<!DOCTYPE html>
<html ng-app="stockvoip" class="bg-black">
<head>
<title>Stockvoip</title>
<link rel="stylesheet" href="/style/bootstrap.css">
<link
> href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"
> rel="stylesheet">
<link rel="stylesheet" href="/style/main.css">
</head>
<body class="bg-black">
<nav class="navbar navbar-fixed-top nav-top navbar-header"
> role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a href="http://www.stockwell.com.br" target="_blank"
> class="navbar-brand">Stockwell</a>
</div>
> <ul class="nav navbar-nav navbar-right hidden-sm hidden-xs">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/user/logout">Logout</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div ng-view=""></div>
<script src="/js/dependencies/jquery.js"></script>
<script src="/js/dependencies/angular.js"></script>
<script src="/js/dependencies/angular-route.js"></script>
<script src="/js/dependencies/angular-cookies.js"></script>
<script src="/js/dependencies/angular-sanitize.js"></script>
<script src="/js/dependencies/angular-resource.js"></script>
<script src="/js/app.js"></script>
<script src="/js/controllers/UserController.js"></script>
<script src="/js/services/UserService.js"></script>
> </body>
</html>
LOGIN.hTML
<div class="form-box" ng-controller="UserController">
<header class="header-box">Stockwell</header>
<form role="form">
<div class="body bg-gray">
<div class="form-group">
<input type="text" class="form-control" placeholder="Login" required
> autofocus ng-model="user.nomusu">
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password"
> required ng-model="user.password">
</div>
</div>
<div class="footer">
<button class="btn btn-lg btn-primary btn-block" type="submit"
> ng-click="logIn()">Entrar</button>
<p class="text-center">
<a href="http://www.stockwell.com.br" target="_blank">Stockwell</a>
</p>
</div>
</form>
<div class="margin text-center social">
<p>Encontre-nos por aqui:<p>
<a href="www.facebook.com.br" class="btn btn-primary btn-round">
<i class="fa fa-facebook"></i>
</a>
<a href="www.twitter.com.br" class="btn btn-info btn-round">
<i class="fa fa-twitter"></i>
</a>
<a href="www.youtube.com.br" class="btn btn-danger btn-round">
<i class="fa fa-youtube"></i>
</a>
</div>
</div>
Em quarta-feira, 30 de julho de 2014 11h03min09s UTC-3, Leonan Luppi
escreveu:
>
> Hello Guys,
>
> I have a java web application built with angularJS. So I've a index.html,
> inside I've create a <div ng-view></div> to display my routes, but inside
> index.html I always have a menu (to show only with the user is logged) and
> other things.. So I've a login.html to display my signin page, when I click
> to logIn I need to show my menu(inside index.html) and hide this when I'm
> back to signin page.. Someone has any idea how to do this?
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.