3

i created an instance of class Meetings:

export var meeting: Meetings; //create a meeting instance of Meeting class present into meeting.ts

and when i call a function called "meetForMe()" on Meetings class:

var myMeeting = meeting.meetForMe(email);

i receive this error:

Cannot read property 'meetForMe' of undefined

I have declared class Meetings in this way:

export class Meetings{....}
0

2 Answers 2

2

Object shoud be created before it can be used:

export var meeting = new Meetings();

In your code you just declare a variable of "Meetings" type.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect it work! I don't understand because on typescript format it doesn't work.
1

You haven't initialized the meeting variable yet. Try export var meeting: Meetings = new Meetings(); instead

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.