Created
August 5, 2014 15:03
-
-
Save fernandofleury/500d98e172ffdcf983f9 to your computer and use it in GitHub Desktop.
angular-browserify
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
(function(){ | |
'use strict'; | |
var router = require('./router/router.js'), | |
UsersViewCtrl = require('./controllers/users/view'), | |
UsersNewCtrl = require('./controllers/users/new'), | |
UsersEditCtrl = require('./controllers/users/edit'), | |
angular.module('app', ['ngRoute']) | |
.config(router) | |
.controller('UsersViewCtrl', UsersViewCtrl) | |
.controller('UsersNewCtrl', UsersNewCtrl) | |
.controller('UsersEditCtrl', UsersEditCtrl); | |
})(); | |
// router | |
(function(){ | |
'use strict'; | |
module.exports = ['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider){ | |
$routeProvider.when('/', { | |
templateUrl: 'views/users/view.html', | |
controller: 'UsersViewCtrl' | |
}) | |
.when('/new', { | |
templateUrl: 'views/users/form.html', | |
controller: 'UsersNewCtrl' | |
}) | |
.when('/edit/:user', { | |
templateUrl: 'views/users/form.html', | |
controller: 'UsersEditCtrl' | |
}) | |
.otherwise({ | |
redirectTo: '/' | |
}); | |
$locationProvider.html5Mode(true); | |
}]; | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment