Magento 2 Knockout JS How to bind data from response of ajax call
At first, add your variable to defaults object, and you will be able to set default value for field.
defaults: {
bankImage : null
}
Define your variable as observable
/**
* Initialize observable properties
*/
initObservable: function () {
this._super()
.observe('bankImage');
return this;
},
And you need to define correct success handler with component context:
success: (function(result) {
this.bankImage(result.image);
}).bind(this),
<img id="bankImage" class="bank_photo" src="">
And in success function added ->
$('#bankImage').attr('src',result.image);
My problem solved