angularjs - Access $locale in angular.module('xxx').value -


i'm using angular-ui:s date directive (uidate) , need configure it. can this:

app.value('ui.config', {     date: {         dateformat: 'yy-mm-dd', // <-- want use $locale.shortdateformat         changemonth: true,         changeyear: false     } }); 

where app application module.

what define dateformat angulars $locale object, using i18n contains cultures specific date-formats.

the value property of app not seem have access $locale @ point though, i'm feeling wrong way it.

how can provide dateformat , other stuff locale-object directives, without having modify source code of ui-date (since it's external dependency of project).

i can solve setting object in controllers, that's not want. configuration should work in controllers.

angularui undergoing bit of refactoring changes slightly.

anyway, can pass dateformat property uidate inline, merged global configuration. don't know if it's possible set .value() within app.run suggested though, think .value() supposed overridable. can try modifying object since theoretically reference preserved (depending on when directive injection function executed).

sorry it's not more helpful.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -