在更新到angular9 Ivy之前,我曾经在单个
中有多个mat-hints<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;
}
也许是该错误的原因?