angular-material2 - Angular8 i18n for placeholderLabel 文本
问题描述
如何在 ngx-mat-select-search palceholderLabel 中添加 i18n
<div class="form-group col-md-6 mb-lg-5 mb-4">
<mat-form-field class="example-full-width w-100">
<mat-select (selectionChange)='vehicle_maker_updated($event)' formControlName="vehicleMakerValue" placeholder="Motor Make" i18n-placeholder>
<mat-option>
<ngx-mat-select-search formControlName="vehicleMakerFilterInputValue" placeholder="Select Motor Maker" [noEntriesFoundLabel]="'No matching vehicle makers found'" (ngModelChange)='filter_vehicle_makers($event)' i18n-placeholder></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let vehicle_maker_option of filtered_vehicle_maker_options" [value]="vehicle_maker_option.id">
{{vehicle_maker_option.name}}
</mat-option>
</mat-select>
<mat-error *ngIf="vehicleMakerValue.hasError('required')" i18n>
Select motor make
</mat-error>
</mat-form-field>
</div>
我已经添加了 i18n-placeholder 但它不起作用
解决方案
您需要使用该placeholderLabel
属性(请参阅https://github.com/bithost-gmbh/ngx-mat-select-search#inputs)
<ngx-mat-select-search
formControlName="vehicleMakerFilterInputValue"
placeholderLabel="Select Motor Maker"
[noEntriesFoundLabel]="'No matching vehicle makers found'"
(ngModelChange)='filter_vehicle_makers($event)'
i18n-placeholderLabel>
</ngx-mat-select-search>
placeholderLabel
和i18n-placeholderLabel
属性相关的地方
推荐阅读
- firebase - 使用 onComplete 函数将图像添加到 Firebase 存储的方法是什么
- javascript - 带有 onclick 的表
- c# - .NET Core 3.1 中的路由器区域不工作
- python - 有没有办法在 Seaborn 直方图中显示色调类别内的概率
- mysql - 每两周抛出一次pymysql错误(2006,“MySQL服务器已消失(BrokenPipeError(32,'Broken pipe'))”)
- python - 从json转换后如何将列添加到数据框?
- java - 我们可以在java中使用数组元素作为switch case吗?
- vb.net - 在 Visual Basic 的同一解决方案中关闭另一个项目的表单
- scala - 如何在 Scala 中展平自定义类型的嵌套 NEL?
- javascript - ApexCharts 关于隐藏垂直虚线