関数のコールバック内から変数にアクセスする方法。質問にもっと直接的になる例を示します。スコープ変数 - 値を変数に代入中のエラー
export class FormComponent {
public pedidoSoft:PedidoSoft = new PedidoSoft();
getBrandCard(){
PagSeguroDirectPayment.getBrand({
cardBin: this.pedidoSoft.numCard,
success: function(response) {
this.pedidoSoft.bandCard = response.brand.name;
},
error: function(response) { },
complete: function(response) { }
});
}
次のエラーが表示されます。 this.pedidoSoft.bandCardがresponse.brand.name
とUbuntuを使用しているもの:) – cgTag