Skip to content
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.

Angular 2 demo using @stomp/ng2-stompjs

License

Notifications You must be signed in to change notification settings

stomp-js/ng2-stompjs-demo

 
 

Repository files navigation

@stomp/ng2-stompjs Angular 2 Demo App

A demo application using Angular 2 in Typescript and @stomp/ng2-stompjs, generated with angular-cli.

This application uses APP_INITIALIZER to load configuration settings for STOMP. Using APP_INITIALIZER ensures that Angular application will instantiate the StompService until the config is fetched from the designated HTTP location. It uses a set of libraries https://github.com/ngx-config/core and https://github.com/ngx-config/http-loader that simplies the whole mechanism.

This is a forked version of https://github.com/sjmf/ng2-stompjs-demo

Setup

Install dependencies:

$ npm install

or, if using yarn

$ yarn

Configure details for your Stomp Broker by editing src/api/config.json

The configuration should work as is for a RabbitMQ instance running on localhost with default settings and Web STOMP plugin activated. (see: https://www.rabbitmq.com/web-stomp.html).

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Where Next

Check the following files:

  • src/app/factories/config-loader.factory.ts - Go here to configure backend HTTP endpoint/path to fetch the configuration.
  • src/app/app.module.ts and src/app/factories/stomp-config.factory.ts - Service provisions for Dependency Injection.
  • src/app/components/rawdata/rawdata.component.ts - subscribing / unsubscribing a queue and publishing messages.
  • src/app/components/status/status.component.ts - monitoring status of Stomp connection.

Contributors

License

MIT

About

Angular 2 demo using @stomp/ng2-stompjs

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 80.9%
  • JavaScript 13.1%
  • HTML 5.5%
  • CSS 0.5%