Skip to content

Instantly share code, notes, and snippets.

@Baudin999
Created January 13, 2014 13:01
Show Gist options
  • Save Baudin999/8399871 to your computer and use it in GitHub Desktop.
Save Baudin999/8399871 to your computer and use it in GitHub Desktop.
Add routes to angularJS's $routeProvider where rpv is a variable (pointer) to the actual routeprovider
app.run(function ($http) {
$http.get('/api/menu').then(function (routes) {
routes.data.forEach(function (route) {
rpv.when(route, {
controller: '<controller name>',
templateUrl: '<tempalte name>',
reloadOnSearch: false
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment