是否可以在管道参数中使用插值?
Is it possible to use interpolation in a pipe parameter?
我有一个这样的烟斗:
{{ testValue2 | customRound:4 }}
我想知道我是否可以在参数中使用插值,以便我可以传递一个变量值而不是硬编码的“4”。
我试过这个,但它不起作用:
{{ testValue2 | customRound:{{customParameter}} }}
如果我不能使用 {{}},有什么方法可以将参数的值绑定到组件中的变量?
只需使用以下内容:
{{ testValue2 | customRound:customParameter }}
我有一个这样的烟斗:
{{ testValue2 | customRound:4 }}
我想知道我是否可以在参数中使用插值,以便我可以传递一个变量值而不是硬编码的“4”。 我试过这个,但它不起作用:
{{ testValue2 | customRound:{{customParameter}} }}
如果我不能使用 {{}},有什么方法可以将参数的值绑定到组件中的变量?
只需使用以下内容:
{{ testValue2 | customRound:customParameter }}