I'm trying to inject datepickerConfig inside the run phase, but angular says that it's unable to find the provider: Unknown provider: datepickerConfigProvider <- datepickerConfig
.
this is the code:
(function () {
angular.module('app', ['ngAnimate', 'ngCookies', 'ngRoute', 'ngSanitize', 'pascalprecht.translate', 'ui.bootstrap', 'ui.select']);
// config phase is omitted, it only configures the i18n async loading
function runFn($translate, datepickerConfig) {
datepickerConfig.currentText = $translate('label.today');
datepickerConfig.clearText = $translate('label.clear');
datepickerConfig.closeText = $translate('label.close');
}
runFn.$inject('$translate', 'datepickerConfig');
angular.module('app').run(runFn);
})();
I also tried to inject datepickerConfig inside the config phase, but angular gave me the same error.
I really can't figure out what is the problem.
In the index.html i have all the .js I need
<script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
<script type="text/javascript" src="scripts/app.js"></script>
what's wrong?
Thanks