angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.28k stars 6.73k forks source link

Unable to set close-text attribute #6555

Open Pirozek opened 7 years ago

Pirozek commented 7 years ago

Hey, I am trying to localize datepicker in popup, so I included angular-i18n file and names of months and days translated correctly, but there is a problem with translating popup button texts. According to documentation (http://angular-ui.github.io/bootstrap/#!#datepickerPopup) I should be able to set them via datepicker-options, but this is not working. Same problem is when I try to add them directly to datepicker-popup element as attribute. Every other config option is working, but not these.

Is it a bug, or am I doing something wrong? Here is example on plunker taken straight from documentation, when I add closeText to config object it doesn't change.

https://plnkr.co/edit/sNUCc44TiHq5njIxYROo?p=preview

WVWillHall commented 7 years ago

You are changing the text :) (default value of button is 'Done'

on yours look at "close-text" on input

          <input close-text="This Will Change It" type="text" class="form-control" uib-datepicker-popup="{{format}}" ng-model="dt" is-open="popup1.opened" datepicker-options="dateOptions" ng-required="true" alt-input-formats="altInputFormats" />
Pirozek commented 7 years ago

Thanks for answer, yea, its working when I apply it directly to the element, but why can't I use it via datepickerOptions object?

WVWillHall commented 7 years ago

https://github.com/angular-ui/bootstrap/blob/master/src/datepickerPopup/popup.js

it is set in the directive, not the controller.