Reputation: 601
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{....}
Upvotes: 3
Views: 753
Reputation: 15407
You haven't initialized the meeting
variable yet. Try export var meeting: Meetings = new Meetings();
instead
Upvotes: 1
Reputation: 7641
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.
Upvotes: 2