🎩 Automagically Unsubscribe in Angular
Netanel Basal
1.2K16

it’s awesome article but i facing issue when the following line is executing.

const property = this[prop];

so the above line working fine for all the properties but expect setter and getter property and give me the following error.

caused by: object unsubscribed

my setter and getter property definition is

private _model$ = new BehaviorSubject<any>({});

@Input()

set model(model) {

this._model$.next(model);

}

get model():any {

return this._model$.getValue();

}