1
我試圖從@Input()tweets獲得isActivated。但是,當我想將isActivated存儲到變量中時,會出現此錯誤:Tweet未定義。這是我的代碼:(對不起我的英文)@Input()在Angular 2中未定義的值
export class SingleTweetComponent {
@Input() tweet;
isActivated = tweet.isActivated;
likeButton($event){
this.tweet.totalLikes = this.tweet.totalLikes - 1;
}
}