I have the default site routes in constant
:
app.constant('defaultRoutes', {
home: {
url: '/home',
templateUrl: 'templates/home.html',
controller: 'HomeController'
},
[...demais rotas....]
});
I am calling this constant
in this provider
app.provider("routeConfig", function (defaultRoutes,$httpProvider) {
[... logica aqui...]
this.$get = defaultRoutes;
});
This provider
will be instantiated in app.config()
app.config(function($stateProvider,$urlRouterProvider,routeConfigProvider) {
[...lógica para configurar as rotas...]
})
Override the default values without changing the constant
?
I've tried to replace constant
with value
but this can only be used after app.config()
initialization.