Add more text after using a filter in ng-bind in angularjs

前端 未结 2 618
旧巷少年郎
旧巷少年郎 2021-02-01 11:59

So I want to put a variable through a filter inthe ng-bind directive

ng-bind=\"input | filter\"

but I want to insert more text



        
2条回答
  •  攒了一身酷
    2021-02-01 13:04

    Instead of interpolating(using {{}}) something in the ng-bind directive you can simply enclose the filtered value with a parenthesis and append your text.

    furthermore, if the text you want to add is not in any way dynamic then I suggest you append another element to bind the filtered value and then add the text after that element.

    e.g.

    more stuff

    This saves you one concatenation process.

    Example here

提交回复
热议问题