带有多个Mat提示的Angular 9 Ivy错误<mat-form-field>

时间:2020-07-09 16:04:06

标签: angular ivy

在更新到angular9 Ivy之前,我曾经在单个

中有多个mat-h​​ints
<div class="example-container">
  <mat-form-field hintLabel="Max 10 characters" appearance="fill">
    <mat-label>Enter some input</mat-label>
    <input matInput #input maxlength="10" placeholder="Ex. Nougat">
    <mat-hint align="end">{{input.value?.length || 0}}/10</mat-hint>

    <mat-label>Select me</mat-label>
    <mat-select>
      <mat-option value="option">Option</mat-option>
    </mat-select>
    <mat-hint align="end">Here's the dropdown arrow ^</mat-hint>
  </mat-form-field>
</div>

但是现在,我收到错误ERROR 错误:已经声明了“ align =“ end”'的提示。

我在角度文件form-field.js中看到了箭头功能使用的

 (hint) => {
                if (hint.align === 'start') {
                    if (startHint || this.hintLabel) {
                        throw getMatFormFieldDuplicatedHintError('start');
                    }
                    startHint = hint;
                }
                else if (hint.align === 'end') {
                    if (endHint) {
                        throw getMatFormFieldDuplicatedHintError('end');
                    }
                    endHint = hint;
                }

之前

  function (hint) {
                if (hint.align === 'start') {
                    if (startHint_1 || _this.hintLabel) {
                        throw getMatFormFieldDuplicatedHintError('start');
                    }
                    startHint_1 = hint;
                }
                else if (hint.align === 'end') {
                    if (endHint_1) {
                        throw getMatFormFieldDuplicatedHintError('end');
                    }
                    endHint_1 = hint;
                }

也许是该错误的原因?

0 个答案:

没有答案