Trying to understand scope on angular 5 .then
问题 On this example, the promise that i created works ok. But the promise from the google api don't work. It says that the this.youtube is undefined index.html <script src="https://apis.google.com/js/api.js"></script> app.component.html <button (click)="customClick()">custom Promise</button> <hr> <hello name="{{ youtube }}"></hello> <button (click)="youtubeClick()">youtube Promise</button> app.component.ts import { Component } from '@angular/core'; import { } from '@types/gapi.client.youtube';