Skip to content

Instantly share code, notes, and snippets.

@Elexy
Last active January 4, 2016 03:38
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 Elexy/8562720 to your computer and use it in GitHub Desktop.
Save Elexy/8562720 to your computer and use it in GitHub Desktop.
Gain access to the angular ui router at runtime
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