How to two-way bind my own RxJS Subject to an [(ngModel)]?

前端 未结 6 631
一生所求
一生所求 2021-01-31 15:42

Is there a short and simple way to pass an RxJS Subject or BehaviorSubject to an an Angular 2 directive for two-way binding? The long way to do it would be as follows:



        
6条回答
  •  长发绾君心
    2021-01-31 16:17

    I tried this and it worked

    {{ searchTerm | async }}

    I'm not sure it this is breaking any rules and if it's buggy or hacky but seems to work for me. I wish Angular had a built it subject directive like they do with forms.

    Hope this helps

提交回复
热议问题