nevermind, solved

import { Component } from 'angular2/core';
import { Panel } from 'primeng/primeng';
@Component
({
    selector: "interactive",
    templateUrl: "scripts/spa/templates/interactive-app.component.html",
    directives: [Panel]
})
export class InteractiveApp
{
    data: any;
    
    constructor()
    {
        var ws = new WebSocket("ws://localhost:8888/websocket");
        ws.onopen = function( ) { ws.send("listening") };
        ws.onmessage = (msg) => this.handle_data(msg.data);
    }
    
    handle_data(data)
    {
        window.console.log(data);
        this.data = JSON.parse(data);
    }
    
}



-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to