Advertisement
Guest User

Untitled

a guest
Jul 31st, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {Component, ViewChild, AfterViewInit} from "@angular/core";
  2.     import {Router} from '@angular/router';
  3.     import {User} from "./user.model";
  4.     import {tplUrl} from "../../extensions";
  5.     import {WebSocketService} from "../main/websocket.service";
  6.     import {NotificationComponent} from "../notification/notification.component";
  7.     import {AppLocaleService} from "../localization/localization.service";
  8.     import {WebSocketBroadcaster} from "../main/websocket.broadcaster";
  9.    
  10.     @Component({
  11.         selector: 'client',
  12.         templateUrl: tplUrl('client'),
  13.         providers: [WebSocketService, AppLocaleService],
  14.         directives: [NotificationComponent]
  15.     })
  16.     export class ClientComponent implements AfterViewInit {
  17.         // @ViewChild(NotificationComponent) private notification:NotificationComponent;
  18.    
  19.         protected router:Router;
  20.         private loc:Object;
  21.    
  22.         model:User;
  23.         submitted = false;
  24.         active = true;
  25.    
  26.         constructor(router:Router, private ws:WebSocketService, private locale: AppLocaleService, private broadcast: WebSocketBroadcaster) {
  27.             this.model = new User('Andrey', 'Jakovenko', 'eUd-XlNrd');
  28.             this.router = router;
  29.             this.loc = locale.gl('client');
  30.             this.broadcast.ee.subscribe((data) => {
  31.                 console.log(data);
  32.             });
  33.         }
  34.    
  35.         ngAfterViewInit () {
  36.             console.log(this.broadcast.ee.subscribe());
  37.             this.broadcast.ee.subscribe((data) => {
  38.                 console.log(data);
  39.             });
  40.    
  41.         }
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement