[英]Angular Daterangepicker Change Locale
我的問題是關於daterangepicker.com中的小部件的。 我面臨的問題是,當我嘗試通過更改選項 $ scope.opts = {...}來更改語言環境時, ng-model $ scope.date = {...}會在此之前綁定,並且始終使用以前語言環境。
<input date-range-picker id="datepick"
autoUpdateInput="true"
name="datepick"
class="form-control date-picker"
type="text"
options="opts"
ng-model="date"
required/>
component.html
> <div class="row">
> <div class="input-field col s12">
> <input formControlName="birthDate" id="birthDate" type="date" class="datepicker" materialize="pickadate" [materializeParams]="[{
> format: 'yyyy-mm-dd', formatSubmit: 'yyyy-mm-dd',
> closeOnSelect: true, selectMonths: true, selectYears: true, today: '',
> max: true, onSet: onSetDatepicker }]">
> <label for="birthDate">Birthday*</label>
> </div> </div>
component.ts
> onSetDatepicker(date) {
> if (date.select) {
> $('#birthDate').pickadate().pickadate('picker').close();
> } }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.