Last active
January 4, 2016 03:38
-
-
Save Elexy/8562720 to your computer and use it in GitHub Desktop.
Gain access to the angular ui router at runtime
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('app').provider 'RouteConfig', | |
['$stateProvider', ($stateProvider) -> | |
# this will configure the routes from the received json | |
# using $stateProvider.state() like in app.config | |
configurator = ($http) - | |
console.log $stateProvider | |
updateRoutes: -> | |
configService.get().then (conf) -> | |
# add routes here from 'conf' | |
@$get = ['configService', (configService, $http) -> | |
new configurator(configService, $http) | |
] | |
return | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment