title: Two way data binding not working from subscribe in Angular?
body: <p>I am subscribing to a subject in Angular, on value change, I am trying to change a variable value in the component. In the console, the value shows an update, but on the view(HTML), it doesn't. </p>
  
  <p><strong>Service.ts</strong></p>
  
  <pre><code>    export class GMapsService {
    public mysubject: Subject&lt;any&gt; = new Subject();
  
    getData(or, des) {
      var origin1 = or;
      var destinationA = des;
      var service = new google.maps.DistanceMatrixService();
      var self = this;
  
      service.getDistanceMatrix(
        {
          origins: [origin1],
          destinations: [destinationA],
          travelMode: 'DRIVING',
          avoidHighways: false,
          avoidTolls: true,
        },
        (response, status) =&gt; {
          // this.mysubject.next(response);
  
          setInterval(
            function () {
              self.mysubject.next(Math.random())
            },
            2000
          )
        }
      );
  
  
    }
  }
  </code></pre>
  
  <p><strong>app.component.ts</strong></p>
  
  <pre><code>    export class AppComponent implements OnInit {
    title: any = 'app';
  
    constructor(private GMapsService: GMapsService) { }
  
    ngOnInit() {
      this.GMapsService.getData('dallas, tx', 'austin, tx');
  
      this.GMapsService.mysubject.subscribe((value) =&gt; {
        this.title = value;
        console.log(this.title);       
   //title is random number in console. ex: 0.4333333
   //title is still 'app' on view till now.
      });
  
  setTimeout(() =&gt; {
        console.log(this.title);
      }, 5000);
  
  
  //title is random number in console.  ex: 0.4333333
  // title suddenly become 'random number  ex: 0.4333333' on view after it is logged after 5 secs. How does logging 'title' again after 5 seconds change its value?
    }
  }
  </code></pre>
  
  <p><strong>app.component.html</strong></p>
  
  <pre><code>{{title}}
  </code></pre>
  
  <p>I believe, if the same value is changing in the console, it should reflect on the view part as well. On other questions, it says, I am missing this context, but the value is getting updated in the console, so I believe I am not missing the context. </p>
  
  <p><strong>Edit</strong>: I tried logging title after 5 seconds, and it suddenly changes on the view. How can just logging the value change it on the view?</p>