У меня есть CellEditor, и я хочу использовать свойство mask в элементе input.
Я получаю сообщение об ошибке More than one custom value accessor matches form control with unspecified name attribute
.
Я хочу применить маску 99.99.9999в CellEditor.
Могу ли я использовать свойство маски с [(ngModel)]?
Шаблон:
<div class="input-group date" (focusout)="onFocusOut($event)">
<input #container triggers="" type="text" #dp="bsDatepicker" class="form-control" (bsValueChange)="onValueChange($event)" bsDatepicker
mask="99.99.9999"
showMaskTyped="true"
[bsConfig]="{ dateInputFormat: 'DD.MM.YYYY', containerClass: 'theme-dark-blue' }"
[(ngModel)]="dateValue"
[minDate]="minDate"
[maxDate]="maxDate">
<span class="input-group-addon" (click)="dp.toggle();" [attr.aria-expanded]="dp.isOpen">
.тс
import { Component, OnInit, AfterViewInit, ViewChild, ViewContainerRef } from '@angular/core';
import { ICellEditorAngularComp } from 'ag-grid-angular';
import { defineLocale } from 'ngx-bootstrap/chronos';
import { deLocale } from 'ngx-bootstrap/locale';
import { BsLocaleService, BsDatepickerConfig } from 'ngx-bootstrap/datepicker';
defineLocale('de', deLocale);
@component({
selector: 'bo-ui-grid-date-picker',
templateUrl: './grid-date-picker.component.html',
styleUrls: ['./grid-date-picker.component.css']
})
export class GridDatePickerComponent implements ICellEditorAngularComp, AfterViewInit {
private params: any;
public dateValue: Date;
minDate: Date;
maxDate: Date;
datePickerConfig: Partial;
@ViewChild('container', {read: ViewContainerRef }) public container;
constructor(private localeService: BsLocaleService) {}
ngAfterViewInit() {
setTimeout(() => {
this.container.element.nativeElement.focus();
})
}
agInit(params: any): void {
this.params = params;
this.datePickerConfig = params.datePickerConfig;
this.minDate = this.datePickerConfig.minDate;
this.maxDate = this.datePickerConfig.maxDate;
this.setValue(params.value);
this.localeService.use('de')
}
...}