EventBus Provider
        
        
        
- Copyright:
 - Kiwigrid GmbH 2014-2015
 
- Source:
 
Classes
Methods
- <inner> create(config) → {ketaEventBus}
 - <inner> getConfig() → {Object}
 - <inner> getDefaultConfig() → {Object}
 - <inner> getInstance() → {eb}
 - <inner> inOfflineMode() → {boolean}
 
- 
    
<inner> create(config) → {ketaEventBus}
 - 
    
    
    
Creates an EventBus instance with given config, which is merged with the default config.
Parameters:
Name Type Description configObject config to use in created EventBus instance - Source:
 
Returns:
ketaEventBus EventBus createdExamples
angular.module('exampleApp', ['keta.services.EventBus']) .config(function(ketaEventBusProvider) { // create with default config var eventBus = ketaEventBusProvider.create(); });angular.module('exampleApp', ['keta.services.EventBus']) .config(function(ketaEventBusProvider) { // create with custom id var eventBus = ketaEventBusProvider.create({id: 'myEventBus'}); });angular.module('exampleApp', ['keta.services.EventBus']) .config(function(ketaEventBusProvider) { // create with custom config // in this case it's exactly the default config var eventBus = ketaEventBusProvider.create({ id: 'kiwibus', url: 'https://localhost:10443/kiwibus', reconnect: true, reconnectTimeout: 5, requestTimeout: 10 }); }); - 
    
<inner> getConfig() → {Object}
 - 
    
    
    
Returns effective config of EventBus instance.
- Source:
 
Returns:
Object effective configurationExample
angular.module('exampleApp', ['keta.services.EventBus']) .controller('ExampleController', function(ketaEventBus) { var effectiveConfig = ketaEventBus.getConfig(); }); - 
    
<inner> getDefaultConfig() → {Object}
 - 
    
    
    
Returns default config used to merge in EventBus instance create method.
- Source:
 
Returns:
Object default configurationExample
angular.module('exampleApp', ['keta.services.EventBus']) .controller('ExampleController', function(ketaEventBus) { var defaultConfig = ketaEventBus.getDefaultConfig(); }); - 
    
<inner> getInstance() → {eb}
 - 
    
    
    
Returns EventBus instance.
- Source:
 
Returns:
eb EventBus instanceExample
angular.module('exampleApp', ['keta.services.EventBus']) .controller('ExampleController', function(ketaEventBus) { var instance = ketaEventBus.getInstance(); }); - 
    
<inner> inOfflineMode() → {boolean}
 - 
    
    
    
Returns true if EventBus is configured to be in offline mode.
- Source:
 
Returns:
boolean true if in offline modeExample
angular.module('exampleApp', ['keta.services.EventBus']) .controller('ExampleController', function(ketaEventBus) { var inOfflineMode = ketaEventBus.inOfflineMode(); });