search

Home  >  Q&A  >  body text

angular.js - Can filters be placed in angular's ng-model?

Can angular’s ​​ng-model put filters?

世界只因有你世界只因有你2793 days ago642

reply all(2)I'll reply

  • 某草草

    某草草2017-05-15 17:08:52

    If it is the filter that comes with angular, it is ok.
    I tried to write a custom filter, but it didn’t work. Sorry.

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-15 17:08:52

    You can use the command require : ngModel
    and then make some settings on the displayed value by setting $viewValue.

    For example, if the input ngModel is saved as date(), it needs to be displayed as HH:mm. This is the case. You can solve it by the above method~

    reply
    0
  • Cancelreply