All Projects → beevelop → ng-stomp

beevelop / ng-stomp

Licence: MIT license
📑 STOMP for AngularJS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ng-stomp

spring-websocket-angular6
Example for using Spring Websocket and Angular with Stomp Messaging
Stars: ✭ 18 (-57.14%)
Mutual labels:  sockjs, stomp
spring-boot-vuejs-websockets
✔️ Simple spring-boot vue.js app with websockets and docker support
Stars: ✭ 30 (-28.57%)
Mutual labels:  sockjs, stomp
ng2-STOMP-Over-WebSocket
STOMP Over WebSocket service for angular2
Stars: ✭ 35 (-16.67%)
Mutual labels:  sockjs, stomp
demo-spring-websocket
'WebSockets with Spring: HTTP and WebSocket; WebSocket with SockJS fallback; STOMP over WebSocket' articles and source code.
Stars: ✭ 30 (-28.57%)
Mutual labels:  sockjs, stomp
spring-websocket-template
Template project for configuring websockets with spring
Stars: ✭ 32 (-23.81%)
Mutual labels:  sockjs, stomp
Quickblox Javascript Sdk
JavaScript SDK of QuickBlox cloud backend platform
Stars: ✭ 98 (+133.33%)
Mutual labels:  bower
Ignition Go
Bootstrap4 /Codeigniter 3 Modular (HMVC) App Building Framework - to build enterprise class web applications... Versions: CodeIgniter 3.1.9 AdminLTE 3.4 Bootstrap 4.5.0
Stars: ✭ 166 (+295.24%)
Mutual labels:  bower
Ungrid
ungrid - the simplest responsive css grid
Stars: ✭ 1,292 (+2976.19%)
Mutual labels:  bower
Bootstrap 4 Ui Kit
Free collection of Bootstrap 4 web blocks.
Stars: ✭ 87 (+107.14%)
Mutual labels:  bower
Asset Packagist
Asset Packagist
Stars: ✭ 235 (+459.52%)
Mutual labels:  bower
Polyserve
Moved to Polymer/tools monorepo
Stars: ✭ 194 (+361.9%)
Mutual labels:  bower
Bootstrap.native
If you are looking for Bootstrap without jQuery, this is it.
Stars: ✭ 1,693 (+3930.95%)
Mutual labels:  bower
Kairos
A non date-based time calculator
Stars: ✭ 100 (+138.1%)
Mutual labels:  bower
Sticky Sidebar
😎 Pure JavaScript tool for making smart and high performance sticky sidebar.
Stars: ✭ 2,057 (+4797.62%)
Mutual labels:  bower
Highcharts Chart
Polymer Element wrapper for highcharts library. Seamlessly create various types of charts from one element.
Stars: ✭ 97 (+130.95%)
Mutual labels:  bower
Jquery Easyui
jquery-easyui lib , update form http://www.jeasyui.com/, useful for git and bower . 给 git and bower 提供lib,与 easyui 官网保持同步
Stars: ✭ 202 (+380.95%)
Mutual labels:  bower
Client Dependencies Gradle
Install client dependencies from NPM, Bower or Git
Stars: ✭ 89 (+111.9%)
Mutual labels:  bower
Vscode Deploy Reloaded
Recoded version of Visual Studio Code extension 'vs-deploy', which provides commands to deploy files to one or more destinations.
Stars: ✭ 129 (+207.14%)
Mutual labels:  bower
Micon
Micon, The iconic windows 10 font and CSS toolkit.
Stars: ✭ 182 (+333.33%)
Mutual labels:  bower
Eon Chart
Realtime animated graphs with PubNub and C3.
Stars: ✭ 121 (+188.1%)
Mutual labels:  bower

npm Travis Maintainability Gemnasium js-standard-style Beevelop

ngStomp

STOMP promised for AngularJS

Installation

Install via npm:

npm install --save ng-stomp

Add standalone version (dependencies included) to your HTML file

<script src="node_modules/ng-stomp/dist/ng-stomp.standalone.min.js"></script>

Or add SockJS + STOMP + (minified) Stompie individually:

<script src="node_modules/sockjs/sockjs.min.js"></script>
<script src="node_modules/@stomp/stompjs/lib/stomp.min.js"></script>
<script src="node_modules/ng-stomp/dist/ng-stomp.min.js"></script>

Usage

Inject it in your controller:

angular
  // Declare ngStomp as a dependency for you module
  .module('app', ['ngStomp'])

  // use $stomp in your controllers, services, directives,...
  .controller('Ctrl', function ($stomp, $scope, $log) {
    $stomp.setDebug(function (args) {
      $log.debug(args)
    })

    $stomp
      .connect('/endpoint', connectHeaders)

      // frame = CONNECTED headers
      .then(function (frame) {
        var subscription = $stomp.subscribe('/dest', function (payload, headers, res) {
          $scope.payload = payload
        }, {
          'headers': 'are awesome'
        })

        // Unsubscribe
        subscription.unsubscribe()

        // Send message
        $stomp.send('/dest', {
          message: 'body'
        }, {
          priority: 9,
          custom: 42 // Custom Headers
        })

        // Disconnect
        $stomp.disconnect().then(function () {
          $log.info('disconnected')
        })
      })
  })

API-Docs (TBD)

  • setDebug(callback)
  • connect(endpoint, headers)
  • disconnect
  • subscribe(destination, callback, headers)
  • on(destination, callback, headers)
  • unsubscribe(subscription)
  • off(subscription)
  • send(destination, body, headers)

Breaking changes

  • Bower support has been removed from v0.5.0 onwards. Please switch to npm / yarn.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].