Issue
I'm using this function to upload the file
async uploadFile(file)
{
let promise = new Promise((resolve, reject) => {
bucket.upload(params, function (err, data) {
this.file=`<a href='${this.FileName}' target=_blank'>File</a>`;
this.send();
resolve(this.FileName);
Calling this.send
but getting this error ERROR TypeError: Cannot read properties of undefined reading angular
at this.send()
line.
Any suggestion to resolve this issue.
Solution
Use arrow function instead of function expression so that upload call back this
will point to parent scope.
bucket.upload(params, (err, data)=> {
.......
});
Answered By - Chellappan வ
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.