Created
January 13, 2014 13:01
-
-
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
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
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