brsocket-angular2
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

BRSocket-Angular2

Socket на angular2. Принимающий события из websocket-a.

Установка

npm i -S brsocket-angular2

Использование

import {SocketModule} from "brsocket-angular2";

@NgModule({
    imports: [
        ... 
        SocketModule
        ...
    ],
    declarations: [
        DemoComponent
    ]
})
export class Demo {
}
@Component({
    .....
})
export class DemoComponent {
    public messages: Message[];

    constructor(protected socket:SocketService) {
    }
    
    ngOnInit() {
        var self = this;
        this.socket.on('chat:message', function (message) {
            self.messages.push(message);
        }, Message);
    }
}

Package Sidebar

Install

npm i brsocket-angular2

Weekly Downloads

1

Version

0.1.0

License

Apache 2.0

Last publish

Collaborators

  • jumper423