2018-03-21 05:21:15 +01:00
import { Component , OnInit , Input } from "@angular/core" ;
2018-03-16 04:48:30 +01:00
import { Stream , TootWrapper } from "../../models/stream.models" ;
import { AccountWrapper } from "../../models/account.models" ;
2018-03-16 02:03:23 +01:00
@Component ( {
2018-03-16 04:48:30 +01:00
selector : "app-stream" ,
templateUrl : "./stream.component.html" ,
styleUrls : [ "./stream.component.css" ]
2018-03-16 02:03:23 +01:00
} )
export class StreamComponent implements OnInit {
2018-03-21 05:21:15 +01:00
private _stream : Stream ;
@Input ( )
set stream ( stream : Stream ) {
this . _stream = stream ;
this . _stream . statuses . subscribe ( ( toots : TootWrapper [ ] ) = > {
for ( let t of toots ) {
this . toots . push ( t ) ;
}
} ) ;
}
get stream ( ) : Stream {
return this . _stream ;
}
2018-03-16 04:48:30 +01:00
toots : TootWrapper [ ] = [ ] ;
2018-03-16 02:03:23 +01:00
constructor ( ) { }
ngOnInit() {
2018-03-16 04:48:30 +01:00
//Stubs
2018-03-21 05:21:15 +01:00
//const newStream = new Stream();
//newStream.streamName = "Stream Name";
//this.stream = newStream;
//const acc1 = new AccountWrapper();
//acc1.username = "@mastodon.social@Gargron";
//acc1.avatar = "https://files.mastodon.social/accounts/avatars/000/000/001/original/4df197532c6b768c.png";
//for (let i = 0; i < 20; i++) {
// const newToot = new TootWrapper();
// newToot.account = acc1;
// newToot.content = "Lorem Elsass ipsum tristique semper elit jetz gehts los lacus habitant Hans sagittis baeckeoffe condimentum id, salu bredele ch'ai libero, ftomi! hop Pfourtz ! id munster auctor, Miss Dahlias rhoncus Yo dû. Salu bissame turpis ante amet non sed gal Spätzle Gal !";
// this.toots.push(newToot);
//}
2018-03-16 04:48:30 +01:00
}
goToTop ( ) : boolean {
return false ;
2018-03-16 02:03:23 +01:00
}
}