Wednesday, 7 June 2017

TypeError: Cannot set property 'value' of undefined

I am trying to use nodejs with typescript. When I compiled code from ts to js and deploy it to nodejs then I am getting error:

TypeError: Cannot set property 'value' of undefined at EmailDataClass.prepareDataForSending (/user_code/sendind.by.email/emailDataClass.js:24:57)

my class looks like:

export class EmailDataClass {
    to: Array<string> = [];

 prepareDataForSending(data) {
        for (let item of data) {
            this.to.push(item.email);

the issue looks like with the push....when I tried to print the item.email then its a string.



via Vitaly Menchikovsky

No comments:

Post a Comment