Skip to content

Instantly share code, notes, and snippets.

@geekgonecrazy
Created March 25, 2014 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geekgonecrazy/9769465 to your computer and use it in GitHub Desktop.
Save geekgonecrazy/9769465 to your computer and use it in GitHub Desktop.
var app = angular.module('guest', []);
app.config(['$controllerProvider', '$routeProvider', '$locationProvider', function ($controllerProvider, $routeProvider, $locationProvider) {
app.controller = $controllerProvider.register;
$locationProvider.html5mode(true);
$routeProvider.when('/', {
templateUrl: '/sometemplate',
controller: 'welcome',
sitearea: 'welcome'
}).otherwise({
templateurl: '/some404'
});
}]);
app.run(['$rootScope', function ($rootScope) {
$rootScope.$on('$routeChangeStart', function (event, next, current) {
$rootScope.sitearea = next.$$route.sitearea;
});
}]);
angular.module('guest').controller('welcome', ['$scope', function ($scope) {
// some controller code
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment