Currently diving into Angular 2 and encountered a stumbling block while attempting to create a service. Despite my efforts in finding a solution, I seem to be missing something crucial.
Error:
A problem arises in angular2-polyfills.js:1243 with the error message stating that 'Tweet is not a constructor'.
Code:
export class TweetService{
getTweets(){
return tweets;
}
}
let tweets = new Tweet("URL", "Author 1", "Handle 1", true, 50);
class Tweet {
image: string;
author: string;
handle: string;
status: "Lorem ipsum dolor sit amet.";
isLiked: boolean;
favorites: number;
constructor(img, aut, hndl, ilkd, fav){
img = this.image;
aut = this.author;
hndl = this.handle;
ilkd = this.isLiked;
fav = this.favorites;
}
}