fix(PrivateComponentLoader): add the loader to the app injector
fixes #1063
This commit is contained in:
parent
19c1773133
commit
65d759316b
2
modules/angular2/src/core/application.js
vendored
2
modules/angular2/src/core/application.js
vendored
@ -26,6 +26,7 @@ import {StyleUrlResolver} from 'angular2/src/core/compiler/style_url_resolver';
|
|||||||
import {StyleInliner} from 'angular2/src/core/compiler/style_inliner';
|
import {StyleInliner} from 'angular2/src/core/compiler/style_inliner';
|
||||||
import {CssProcessor} from 'angular2/src/core/compiler/css_processor';
|
import {CssProcessor} from 'angular2/src/core/compiler/css_processor';
|
||||||
import {Component} from 'angular2/src/core/annotations/annotations';
|
import {Component} from 'angular2/src/core/annotations/annotations';
|
||||||
|
import {PrivateComponentLoader} from 'angular2/src/core/compiler/private_component_loader';
|
||||||
|
|
||||||
var _rootInjector: Injector;
|
var _rootInjector: Injector;
|
||||||
|
|
||||||
@ -107,6 +108,7 @@ function _injectorBindings(appComponentType): List<Binding> {
|
|||||||
StyleUrlResolver,
|
StyleUrlResolver,
|
||||||
StyleInliner,
|
StyleInliner,
|
||||||
bind(CssProcessor).toFactory(() => new CssProcessor(null), []),
|
bind(CssProcessor).toFactory(() => new CssProcessor(null), []),
|
||||||
|
PrivateComponentLoader,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ import {StyleUrlResolver} from 'angular2/src/core/compiler/style_url_resolver';
|
|||||||
import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';
|
import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';
|
||||||
import {StyleInliner} from 'angular2/src/core/compiler/style_inliner';
|
import {StyleInliner} from 'angular2/src/core/compiler/style_inliner';
|
||||||
import {CssProcessor} from 'angular2/src/core/compiler/css_processor';
|
import {CssProcessor} from 'angular2/src/core/compiler/css_processor';
|
||||||
|
import {PrivateComponentLoader} from 'angular2/src/core/compiler/private_component_loader';
|
||||||
|
|
||||||
import {If, For} from 'angular2/directives';
|
import {If, For} from 'angular2/directives';
|
||||||
import {App, setupReflectorForApp} from './app';
|
import {App, setupReflectorForApp} from './app';
|
||||||
@ -34,6 +35,8 @@ import {CompanyNameComponent, OpportunityNameComponent, OfferingNameComponent,
|
|||||||
setupReflectorForCells}
|
setupReflectorForCells}
|
||||||
from './cells';
|
from './cells';
|
||||||
|
|
||||||
|
import {EventManager} from 'angular2/src/core/events/event_manager';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
setupReflector();
|
setupReflector();
|
||||||
bootstrap(App);
|
bootstrap(App);
|
||||||
@ -303,4 +306,17 @@ export function setupReflectorForAngular() {
|
|||||||
"parameters": [],
|
"parameters": [],
|
||||||
"annotations": []
|
"annotations": []
|
||||||
});
|
});
|
||||||
|
|
||||||
|
reflector.registerType(EventManager, {
|
||||||
|
"factory": () => new EventManager([], null),
|
||||||
|
"parameters": [],
|
||||||
|
"annotations": []
|
||||||
|
});
|
||||||
|
|
||||||
|
reflector.registerType(PrivateComponentLoader, {
|
||||||
|
"factory": (compiler, strategy, eventMgr, reader) =>
|
||||||
|
new PrivateComponentLoader(compiler, strategy, eventMgr, reader),
|
||||||
|
"parameters": [[Compiler], [ShadowDomStrategy], [EventManager], [DirectiveMetadataReader]],
|
||||||
|
"annotations": []
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ import {StyleUrlResolver} from 'angular2/src/core/compiler/style_url_resolver';
|
|||||||
import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';
|
import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';
|
||||||
import {StyleInliner} from 'angular2/src/core/compiler/style_inliner';
|
import {StyleInliner} from 'angular2/src/core/compiler/style_inliner';
|
||||||
import {CssProcessor} from 'angular2/src/core/compiler/css_processor';
|
import {CssProcessor} from 'angular2/src/core/compiler/css_processor';
|
||||||
|
import {PrivateComponentLoader} from 'angular2/src/core/compiler/private_component_loader';
|
||||||
|
|
||||||
import {reflector} from 'angular2/src/reflection/reflection';
|
import {reflector} from 'angular2/src/reflection/reflection';
|
||||||
import {DOM} from 'angular2/src/dom/dom_adapter';
|
import {DOM} from 'angular2/src/dom/dom_adapter';
|
||||||
@ -30,6 +31,8 @@ import {XHRImpl} from 'angular2/src/core/compiler/xhr/xhr_impl';
|
|||||||
import {If} from 'angular2/directives';
|
import {If} from 'angular2/directives';
|
||||||
import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
|
import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
|
||||||
|
|
||||||
|
import {EventManager} from 'angular2/src/core/events/event_manager';
|
||||||
|
|
||||||
function setupReflector() {
|
function setupReflector() {
|
||||||
// TODO: Put the general calls to reflector.register... in a shared file
|
// TODO: Put the general calls to reflector.register... in a shared file
|
||||||
// as they are needed in all benchmarks...
|
// as they are needed in all benchmarks...
|
||||||
@ -190,6 +193,19 @@ function setupReflector() {
|
|||||||
"annotations": []
|
"annotations": []
|
||||||
});
|
});
|
||||||
|
|
||||||
|
reflector.registerType(EventManager, {
|
||||||
|
"factory": () => new EventManager([], null),
|
||||||
|
"parameters": [],
|
||||||
|
"annotations": []
|
||||||
|
});
|
||||||
|
|
||||||
|
reflector.registerType(PrivateComponentLoader, {
|
||||||
|
"factory": (compiler, strategy, eventMgr, reader) =>
|
||||||
|
new PrivateComponentLoader(compiler, strategy, eventMgr, reader),
|
||||||
|
"parameters": [[Compiler], [ShadowDomStrategy], [EventManager], [DirectiveMetadataReader]],
|
||||||
|
"annotations": []
|
||||||
|
});
|
||||||
|
|
||||||
reflector.registerGetters({
|
reflector.registerGetters({
|
||||||
'value': (a) => a.value,
|
'value': (a) => a.value,
|
||||||
'left': (a) => a.left,
|
'left': (a) => a.left,
|
||||||
|
@ -19,6 +19,8 @@ import {StyleUrlResolver} from 'angular2/src/core/compiler/style_url_resolver';
|
|||||||
import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';
|
import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';
|
||||||
import {StyleInliner} from 'angular2/src/core/compiler/style_inliner';
|
import {StyleInliner} from 'angular2/src/core/compiler/style_inliner';
|
||||||
import {CssProcessor} from 'angular2/src/core/compiler/css_processor';
|
import {CssProcessor} from 'angular2/src/core/compiler/css_processor';
|
||||||
|
import {EventManager} from 'angular2/src/core/events/event_manager';
|
||||||
|
import {PrivateComponentLoader} from 'angular2/src/core/compiler/private_component_loader';
|
||||||
|
|
||||||
import {reflector} from 'angular2/src/reflection/reflection';
|
import {reflector} from 'angular2/src/reflection/reflection';
|
||||||
|
|
||||||
@ -170,6 +172,19 @@ function setup() {
|
|||||||
"annotations": []
|
"annotations": []
|
||||||
});
|
});
|
||||||
|
|
||||||
|
reflector.registerType(EventManager, {
|
||||||
|
"factory": () => new EventManager([], null),
|
||||||
|
"parameters": [],
|
||||||
|
"annotations": []
|
||||||
|
});
|
||||||
|
|
||||||
|
reflector.registerType(PrivateComponentLoader, {
|
||||||
|
"factory": (compiler, strategy, eventMgr, reader) =>
|
||||||
|
new PrivateComponentLoader(compiler, strategy, eventMgr, reader),
|
||||||
|
"parameters": [[Compiler], [ShadowDomStrategy], [EventManager], [DirectiveMetadataReader]],
|
||||||
|
"annotations": []
|
||||||
|
});
|
||||||
|
|
||||||
reflector.registerGetters({
|
reflector.registerGetters({
|
||||||
"greeting": (a) => a.greeting
|
"greeting": (a) => a.greeting
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user