-1

I have this statement in my angular 4 component methods

private valueChanges: any;

 ngOnInit() {
    this.valueChanges = this.form.valueChanges.subscribe(console.log);
 }

so just want to know what will be the typing of valueChanges variable currently set any

which one is correct?

  1. valueChanes: Observable;
  2. valueChanges: Subject;
  3. valueChanges: Subscription;
xkeshav
  • 53,360
  • 44
  • 177
  • 245

1 Answers1

1

According to Angular Observable document:

The subscribe() call returns a Subscription object that has an unsubscribe() method, which you call to stop receiving notifications.

Daniel Tran
  • 6,083
  • 12
  • 25