Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Component, ViewChild, AfterViewInit} from "@angular/core";
- import {Router} from '@angular/router';
- import {User} from "./user.model";
- import {tplUrl} from "../../extensions";
- import {WebSocketService} from "../main/websocket.service";
- import {NotificationComponent} from "../notification/notification.component";
- import {AppLocaleService} from "../localization/localization.service";
- import {WebSocketBroadcaster} from "../main/websocket.broadcaster";
- @Component({
- selector: 'client',
- templateUrl: tplUrl('client'),
- providers: [WebSocketService, AppLocaleService],
- directives: [NotificationComponent]
- })
- export class ClientComponent implements AfterViewInit {
- // @ViewChild(NotificationComponent) private notification:NotificationComponent;
- protected router:Router;
- private loc:Object;
- model:User;
- submitted = false;
- active = true;
- constructor(router:Router, private ws:WebSocketService, private locale: AppLocaleService, private broadcast: WebSocketBroadcaster) {
- this.model = new User('Andrey', 'Jakovenko', 'eUd-XlNrd');
- this.router = router;
- this.loc = locale.gl('client');
- this.broadcast.ee.subscribe((data) => {
- console.log(data);
- });
- }
- ngAfterViewInit () {
- console.log(this.broadcast.ee.subscribe());
- this.broadcast.ee.subscribe((data) => {
- console.log(data);
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement