Created
July 25, 2019 13:05
-
-
Save pinkhominid/0fed9f78a36de41f3e96db4f638721d3 to your computer and use it in GitHub Desktop.
UI-Router Boilerplate
This file contains hidden or 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'; | |
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