When to use a filter vs a directive in Angularjs

前端 未结 3 1035
野的像风
野的像风 2021-02-05 10:37

It\'s a simple question - and it may have been asked (just couldn\'t find it..)

When would you use a filter over a directive when it comes to manipulating the data, or v

3条回答
  •  梦谈多话
    2021-02-05 11:06

    Clear and simple

    Filter for general Data filtering / transformation

    Directive for DOM Manipulation / UI behavior


    In your case you can write it like so:

      
    {{ testMessage + ' result' }}

提交回复
热议问题