lon*_*bow 4 angular-pipe angular
我想<input type='text' placeholder=' {{ 'somestring' | getText }}'>使用管道动态设置占位符.(这种方法不起作用)
管道本身工作得很好,例如
<p>{{ myVariable | getText}}</p>将正确渲染,以及<p>{{ 'someString' | getText}}</p>
如何使用它来动态设置占位符字符串?
您可以使用Matthias的建议或使用双引号.事实上,-always-使用双引号!
<input type="text" placeholder="{{ 'somestring' | getText }}">
Run Code Online (Sandbox Code Playgroud)
要么
<input type="text" [placeholder]="'somestring' | getText">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6405 次 |
| 最近记录: |