Skip to content

Instantly share code, notes, and snippets.

@TheLarkInn
Last active November 30, 2016 16:00
Show Gist options
  • Save TheLarkInn/ca679d2830045e4208ff6acd0495e76e to your computer and use it in GitHub Desktop.
Save TheLarkInn/ca679d2830045e4208ff6acd0495e76e to your computer and use it in GitHub Desktop.
How to bundle up custom plugins with EVENT_MANAGER_PLGUINS
import {bootstrap} from 'angular2/platform/browser';
import {DIRECTIVES, PIPES, PROVIDERS, ENV_PROVIDERS, PLUGINS} from './platform/browser';
import {App, APP_PROVIDERS} from './app';
bootstrap(App, [
...PROVIDERS,
...ENV_PROVIDERS,
...DIRECTIVES,
...PIPES,
...APP_PROVIDERS,
...PLUGINS
]).catch(console.error)
import {provide} from 'angular2/core';
import {EVENT_MANAGER_PLUGINS} from 'angular2/platform/common_dom';
import {DOMOutsideEventPlugin} from './util';
/*
Add custom event plugins here.
*/
export const EVENT_PLUGINS = [
DOMOutsideEventPlugin
]
export const PLUGINS = [
provide(EVENT_MANAGER_PLUGINS, { multi: true, useClass: MultiEventPlugin}),
provide(EVENT_MANAGER_PLUGINS, { multi: true, useClass: DOMOutsideEventPlugin})
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment