refactor(ProtoViewDto): switch to enum

This commit is contained in:
Victor Berchet
2015-06-09 15:20:33 +02:00
parent af35ab56a3
commit 6ca81fb98c
12 changed files with 38 additions and 38 deletions

View File

@ -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;

View File

@ -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';