Created
March 25, 2014 19:35
-
-
Save geekgonecrazy/9769465 to your computer and use it in GitHub Desktop.
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 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; | |
}); | |
}]); |
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
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