fix(platform-browser): enable AOT

closes #12783
This commit is contained in:
Victor Berchet 2016-11-09 16:06:32 -08:00
parent c2fae72bc6
commit efbbefd353
1 changed files with 7 additions and 10 deletions

View File

@ -15,7 +15,7 @@ import {DomRootRenderer} from '../dom_renderer';
const CORE_TOKENS = { const CORE_TOKENS = {
'ApplicationRef': core.ApplicationRef, 'ApplicationRef': core.ApplicationRef,
'NgZone': core.NgZone 'NgZone': core.NgZone,
}; };
const INSPECT_GLOBAL_NAME = 'ng.probe'; const INSPECT_GLOBAL_NAME = 'ng.probe';
@ -26,7 +26,7 @@ const CORE_TOKENS_GLOBAL_NAME = 'ng.coreTokens';
* null if the given native element does not have an Angular view associated * null if the given native element does not have an Angular view associated
* with it. * with it.
*/ */
export function inspectNativeElement(element: any /** TODO #9100 */): core.DebugNode { export function inspectNativeElement(element: any): core.DebugNode {
return core.getDebugNode(element); return core.getDebugNode(element);
} }
@ -40,16 +40,13 @@ export class NgProbeToken {
export function _createConditionalRootRenderer( export function _createConditionalRootRenderer(
rootRenderer: any /** TODO #9100 */, extraTokens: NgProbeToken[], rootRenderer: any, extraTokens: NgProbeToken[], coreTokens: core.NgProbeToken[]) {
coreTokens: core.NgProbeToken[]) { return core.isDevMode() ?
if (core.isDevMode()) { _createRootRenderer(rootRenderer, (extraTokens || []).concat(coreTokens || [])) :
const tokens = (extraTokens || []).concat(coreTokens || []); rootRenderer;
return _createRootRenderer(rootRenderer, tokens);
}
return rootRenderer;
} }
function _createRootRenderer(rootRenderer: any /** TODO #9100 */, extraTokens: NgProbeToken[]) { function _createRootRenderer(rootRenderer: any, extraTokens: NgProbeToken[]) {
getDOM().setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement); getDOM().setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement);
getDOM().setGlobalVar( getDOM().setGlobalVar(
CORE_TOKENS_GLOBAL_NAME, CORE_TOKENS_GLOBAL_NAME,