Last active
November 30, 2016 16:00
-
-
Save TheLarkInn/ca679d2830045e4208ff6acd0495e76e to your computer and use it in GitHub Desktop.
How to bundle up custom plugins with EVENT_MANAGER_PLGUINS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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