2018-03-21 05:21:15 +01:00
|
|
|
import { Component, OnInit } from "@angular/core";
|
|
|
|
|
|
|
|
import { Stream } from "../../models/stream.models";
|
|
|
|
import { StreamsService } from "../../services/streams.service";
|
|
|
|
|
2018-03-16 01:43:53 +01:00
|
|
|
|
|
|
|
@Component({
|
2018-03-21 05:21:15 +01:00
|
|
|
selector: "app-streams-main-display",
|
|
|
|
templateUrl: "./streams-main-display.component.html",
|
|
|
|
styleUrls: ["./streams-main-display.component.css"]
|
2018-03-16 01:43:53 +01:00
|
|
|
})
|
|
|
|
export class StreamsMainDisplayComponent implements OnInit {
|
2018-03-17 00:57:14 +01:00
|
|
|
streams: Stream[] = [];
|
2018-03-16 01:43:53 +01:00
|
|
|
|
2018-03-21 05:21:15 +01:00
|
|
|
constructor(private readonly streamService: StreamsService) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2018-03-16 01:43:53 +01:00
|
|
|
|
|
|
|
ngOnInit() {
|
2018-03-21 05:21:15 +01:00
|
|
|
this.streamService.streamsSubject.subscribe((streams: Stream[]) => {
|
|
|
|
for (let s of streams) {
|
|
|
|
this.streams.push(s);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
//for (let i = 0; i < 3; i++) {
|
|
|
|
// this.streams.push(new Stream());
|
|
|
|
//}
|
2018-03-16 01:43:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|