I am learning Angular 2 and I ran into this error while trying to create a service. I tried searching for a solution, but I cannot see my mistake.
Error:
angular2-polyfills.js:1243 TypeError: 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;
}
}