refactor: change template for view where it makes sense

This commit is contained in:
Victor Berchet
2015-06-24 11:10:29 +02:00
parent b15474c6f2
commit a0e0f3123b
8 changed files with 52 additions and 58 deletions

View File

@ -37,10 +37,10 @@ export class TestBed {
* @see setInlineTemplate() to only override the html
*
* @param {Type} component
* @param {ViewDefinition} template
* @param {ViewDefinition} view
*/
overrideView(component: Type, template: View): void {
this._injector.get(ViewResolver).setView(component, template);
overrideView(component: Type, view: View): void {
this._injector.get(ViewResolver).setView(component, view);
}
/**

View File

@ -74,7 +74,7 @@ export class TestComponentBuilder {
/**
* Overrides only the html of a {@link Component}.
* All the other propoerties of the component's {@link View} are preserved.
* All the other properties of the component's {@link View} are preserved.
*
* @param {Type} component
* @param {string} html
@ -130,9 +130,8 @@ export class TestComponentBuilder {
var mockViewResolver = this._injector.get(ViewResolver);
MapWrapper.forEach(this._viewOverrides,
(view, type) => { mockViewResolver.setView(type, view); });
MapWrapper.forEach(this._templateOverrides, (template, type) => {
mockViewResolver.setInlineTemplate(type, template);
});
MapWrapper.forEach(this._templateOverrides,
(template, type) => { mockViewResolver.setInlineTemplate(type, template); });
MapWrapper.forEach(this._directiveOverrides, (overrides, component) => {
MapWrapper.forEach(overrides, (to, from) => {
mockViewResolver.overrideViewDirective(component, from, to);