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

@ -317,7 +317,7 @@ export function main() {
createRenderProtoView([
createRenderViewportElementBinder(
createRenderProtoView([createRenderComponentElementBinder(0)],
renderApi.ProtoViewDto.EMBEDDED_VIEW_TYPE))
renderApi.ViewType.EMBEDDED))
]),
createRenderProtoView()
],
@ -379,7 +379,7 @@ export function main() {
renderCompiler.spy('compileHost')
.andCallFake((componentId) => {
return PromiseWrapper.resolve(createRenderProtoView(
[createRenderComponentElementBinder(0)], renderApi.ProtoViewDto.HOST_VIEW_TYPE));
[createRenderComponentElementBinder(0)], renderApi.ViewType.HOST));
});
tplResolver.setView(MainComponent, new viewAnn.View({template: '<div></div>'}));
var rootProtoView =
@ -429,9 +429,9 @@ function createViewportElementBinder(nestedProtoView) {
return elBinder;
}
function createRenderProtoView(elementBinders = null, type: number = null) {
function createRenderProtoView(elementBinders = null, type: renderApi.ViewType = null) {
if (isBlank(type)) {
type = renderApi.ProtoViewDto.COMPONENT_VIEW_TYPE;
type = renderApi.ViewType.COMPONENT;
}
if (isBlank(elementBinders)) {
elementBinders = [];

View File

@ -146,9 +146,9 @@ function directiveBinding({metadata}: {metadata?: any} = {}) {
return new DirectiveBinding(Key.get("dummy"), null, [], false, [], [], [], metadata);
}
function createRenderProtoView(elementBinders = null, type: number = null) {
function createRenderProtoView(elementBinders = null, type: renderApi.ViewType = null) {
if (isBlank(type)) {
type = renderApi.ProtoViewDto.COMPONENT_VIEW_TYPE;
type = renderApi.ViewType.COMPONENT;
}
if (isBlank(elementBinders)) {
elementBinders = [];