diff --git a/modules/angular2/src/core/compiler/compiler.ts b/modules/angular2/src/core/compiler/compiler.ts index 737a0717c8..4305c2693e 100644 --- a/modules/angular2/src/core/compiler/compiler.ts +++ b/modules/angular2/src/core/compiler/compiler.ts @@ -161,8 +161,7 @@ export class Compiler { var protoView = protoViews[0]; // TODO(tbosch): we should be caching host protoViews as well! // -> need a separate cache for this... - if (renderPv.type === renderApi.ProtoViewDto.COMPONENT_VIEW_TYPE && - isPresent(componentBinding)) { + if (renderPv.type === renderApi.ViewType.COMPONENT && isPresent(componentBinding)) { // Populate the cache before compiling the nested components, // so that components can reference themselves in their template. var component = componentBinding.key.token; diff --git a/modules/angular2/src/core/compiler/proto_view_factory.ts b/modules/angular2/src/core/compiler/proto_view_factory.ts index b55cb69a76..51a836d961 100644 --- a/modules/angular2/src/core/compiler/proto_view_factory.ts +++ b/modules/angular2/src/core/compiler/proto_view_factory.ts @@ -222,10 +222,10 @@ function _getChangeDetectorDefinitions( bindingRecordsCreator.getDirectiveRecords(elementBinders, allRenderDirectiveMetadata); var strategyName = DEFAULT; var typeString; - if (pvWithIndex.renderProtoView.type === renderApi.ProtoViewDto.COMPONENT_VIEW_TYPE) { + if (pvWithIndex.renderProtoView.type === renderApi.ViewType.COMPONENT) { strategyName = hostComponentMetadata.changeDetection; typeString = 'comp'; - } else if (pvWithIndex.renderProtoView.type === renderApi.ProtoViewDto.HOST_VIEW_TYPE) { + } else if (pvWithIndex.renderProtoView.type === renderApi.ViewType.HOST) { typeString = 'host'; } else { typeString = 'embedded'; diff --git a/modules/angular2/src/render/api.ts b/modules/angular2/src/render/api.ts index 4b8e0f6b1d..fb38f4a204 100644 --- a/modules/angular2/src/render/api.ts +++ b/modules/angular2/src/render/api.ts @@ -92,28 +92,29 @@ export class DirectiveBinder { } } -export class ProtoViewDto { - // A view that contains the host element with bound - // component directive. - // Contains a view of type #COMPONENT_VIEW_TYPE. - static get HOST_VIEW_TYPE() { return 0; } +export enum ViewType { + // A view that contains the host element with bound component directive. + // Contains a COMPONENT view + HOST, // The view of the component - // Can contain 0 to n views of type #EMBEDDED_VIEW_TYPE - static get COMPONENT_VIEW_TYPE() { return 1; } + // Can contain 0 to n EMBEDDED views + COMPONENT, // A view that is embedded into another View via a