Skip to content

Instantly share code, notes, and snippets.

@pinkhominid
Created July 25, 2019 13:05
Show Gist options
  • Save pinkhominid/0fed9f78a36de41f3e96db4f638721d3 to your computer and use it in GitHub Desktop.
Save pinkhominid/0fed9f78a36de41f3e96db4f638721d3 to your computer and use it in GitHub Desktop.
UI-Router Boilerplate
(function() {
'use strict';
angular
.module('theApp')
.config(config);
config.$inject = ['$stateProvider', '$locationProvider', '$urlRouterProvider'];
function config($stateProvider, $locationProvider, $urlRouterProvider) {
$locationProvider.html5Mode(true);
$urlRouterProvider.otherwise('/');
$stateProvider
.state('home', {
url: '/',
resolve: {
log: () => console.log('home')
},
component: 'myComponentA'
})
.state('about', {
url: '/about',
resolve: {
log: () => console.log('about')
},
component: 'myComponentB'
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment