This file contains hidden or 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, PLATFORM_DIRECTIVES, PLATFORM_PIPES} from '@angular/core'; | |
import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router'; | |
import {FORM_PROVIDERS} from '@angular/common'; | |
import {HTTP_PROVIDERS, JSONP_PROVIDERS} from '@angular/http'; | |
import {ELEMENT_PROBE_PROVIDERS /*,ELEMENT_PROBE_PROVIDERS_PROD_MODE*/} from '@angular/platform-browser'; | |
import {LocationStrategy, HashLocationStrategy, Location} from '@angular/common'; | |
/* | |
Add custom env providers here. |
This file contains hidden or 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
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function { | |
var zone = this.manager.getZone(); | |
var eventsArray = this.getMultiEventArray(eventName); | |
// Entering back into angular to trigger changeDetection | |
var outsideHandler = (event) => { | |
zone.run(() => handler(event)) | |
}; | |
// Executed outside of angular so that change detection is not constantly triggered. |
This file contains hidden or 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
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function { | |
var zone = this.manager.getZone(); | |
var eventsArray = this.getMultiEventArray(eventName); | |
// Entering back into angular to trigger changeDetection | |
var outsideHandler = (event) => { | |
zone.run(() => handler(event)) | |
}; | |
// Executed outside of angular so that change detection is not constantly triggered. |
This file contains hidden or 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
getMultiEventArray(eventName: string): string[] { | |
return eventName.split(",") | |
.filter((item, index): boolean => { return item && item != '' }) | |
} | |
supports(eventName: string): boolean { | |
return this.getMultiEventArray(eventName).length > 1 | |
} |
This file contains hidden or 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 { OpaqueToken } from 'angular2/src/core/di'; | |
import { NgZone } from 'angular2/src/core/zone/ng_zone'; | |
export declare const EVENT_MANAGER_PLUGINS: OpaqueToken; | |
export declare class EventManager { | |
private _zone; | |
private _plugins; | |
constructor(plugins: EventManagerPlugin[], _zone: NgZone); | |
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | |
addGlobalEventListener(target: string, eventName: string, handler: Function): Function; | |
getZone(): NgZone; |
This file contains hidden or 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
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function { | |
var plugin = this._findPluginFor(eventName); | |
return plugin.addEventListener(element, eventName, handler); | |
} | |
addGlobalEventListener(target: string, eventName: string, handler: Function): Function { | |
var plugin = this._findPluginFor(eventName); | |
return plugin.addGlobalEventListener(target, eventName, handler); | |
} |
This file contains hidden or 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
listen(renderElement: any, name: string, callback: Function): Function { | |
return this._rootRenderer.eventManager.addEventListener(renderElement, name, | |
decoratePreventDefault(callback)); | |
} | |
listenGlobal(target: string, name: string, callback: Function): Function { | |
return this._rootRenderer.eventManager.addGlobalEventListener(target, name, | |
decoratePreventDefault(callback)); | |
} | |
This file contains hidden or 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 {CONST_EXPR} from 'angular2/src/facade/lang'; | |
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions'; | |
import {Injectable, Inject, OpaqueToken} from 'angular2/src/core/di'; | |
import {NgZone} from 'angular2/src/core/zone/ng_zone'; | |
import {ListWrapper} from 'angular2/src/facade/collection'; | |
export const EVENT_MANAGER_PLUGINS: OpaqueToken = | |
CONST_EXPR(new OpaqueToken("EventManagerPlugins")); | |
@Injectable() |
This file contains hidden or 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, |
This file contains hidden or 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, |