Sengi-Windows-MacOS-Linux/src/app/pages/streams-main-display/streams-main-display.compon...

33 lines
759 B
TypeScript
Raw Normal View History

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({
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
constructor(private readonly streamService: StreamsService) {
}
2018-03-16 01:43:53 +01:00
ngOnInit() {
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
}
}