Closed DanielFurmanov closed 7 years ago
Hi @DanielFurmanov,
As you can see on the documentation, you must use the same names, switching from _
to -
, like so:
Example from docs: http://leocaseiro.github.io/angular-chosen/#translate24
<select multiple chosen
no-results-text="'Nenhum resultado encontrado para'"
placeholder-text-multiple="'Selecione as opções'"
ng-model="state" ng-options="s for s in states">
<option value=""></option>
</select>
@leocaseiro Thank you for your answer! Being a non-native language speaker I must have expressed myself not so clear.
I have ~10 selects on the page, is there an option in angular-chosen-directive to declare a default placeholder (and etc) for all of them in one place, not in every select tag?
What I am doing now in my js:
$scope.textSingleChosenPlaceholder = 'Select something';
$scope.noResultsChosenPlaceholder = 'Nothing found';
And in html:
<select multiple chosen
no-results-text="'textSingleChosenPlaceholder'"
placeholder-text-single="'noResultsChosenPlaceholder'"
<option value=""></option>
</select>
And what I want to do is something like that:
angular.module('App', ['localytics.directives'])
.run(function( localyticsDirectivesOptions ) {
//set default placeholder for any chosen-select on the page
localyticsDirectivesOptions.placeholder_text_single = 'blabla choose smthng';
});
Hi @DanielFurmanov, Unfortunately, there's no Angular.config for angular-chosen at the moment. There's an issue about that #77, however, I've never had the time to implement (Accepting PR).
You could use some variables to use on your <select>
, like so:
<select multiple ng-model="example1" chosen no-results-text="noResultsText"></select>
<select multiple ng-model="example3" chosen no-results-text="noResultsText"></select>
<select multiple ng-model="example2" chosen no-results-text="noResultsText"></select>
$scope.noResultsText = 'My Custom Text';
I'll close this issue in regards to the #77
Greetings!
How do I set
those variables to some other values, when including
localytics.directives
?In other words: how to set default settings for all of chosen-selects on the page