Last active
August 29, 2015 14:13
-
-
Save raphaelLacerda/97a1fc6a9e9aae82dbe8 to your computer and use it in GitHub Desktop.
POst Angular - Js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var caelumapp = angular.module('caelumapp', [ 'ngRoute', 'app.login']); | |
caelumapp.config(['$routeProvider','$locationProvider', | |
function($routeProvider, $locationProvider) { | |
$routeProvider | |
.when('/login', { | |
templateUrl: "app/login/paginas/login.html", | |
controller : "LoginController", | |
controllerAs: "vm" | |
}) | |
.when('/cadastro/usuario', { | |
templateUrl: "app/usuario/paginas/usuario-cadastro.html", | |
controller: 'UsuarioController', | |
controllerAs: 'vm' | |
}) | |
.otherwise({ | |
redirectTo : '/login' | |
}); | |
} ]); | |
----------------------após Angular UI Router--------------- | |
var caelumapp = angular.module('caelumapp', [ 'ui.router', 'app.login']); | |
caelumapp.config(['$stateProvider', '$urlRouterProvider', | |
'$httpProvider', | |
function($stateProvider, $urlRouterProvider) { | |
$urlRouterProvider.otherwise("/login"); | |
$stateProvider | |
.state('login', { | |
url: "/login", | |
templateUrl: "app/login/paginas/login.html", | |
controller : "LoginController", | |
controllerAs: "vm" | |
}) | |
.state('cadastroDeUsuario', { | |
url: "/cadastro/usuario", | |
templateUrl: "app/usuario/paginas/usuario-cadastro.html", | |
controller: 'UsuarioController', | |
controllerAs: 'vm' | |
}) | |
.state('pesquisaDeUsuario', { | |
url: "/usuarios/:id", | |
templateUrl: "app/usuario/paginas/usuario-detalhe.html", | |
controller: 'UsuarioDetalheController', | |
controllerAs: 'vm' | |
}); | |
} ]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment