ngOnChanges not firing when attribute changed by Observable/subscrption

后端 未结 2 1725
隐瞒了意图╮
隐瞒了意图╮ 2021-01-20 14:49

I\'m trying to do something after an Observable/subscribe completes. I\'m changing an Input property in the subscribe( onNext )<

2条回答
  •  面向向阳花
    2021-01-20 15:25

    That's "as designed"

    ngOnChanges() is only called when change detection updates a binding to an @Input(). If the input is changed imperatively from somewhere then it isn't called.

    Just make names a getter/setter for code to be executed every time when the property is updated.

提交回复
热议问题