refactor(core): move NodeType and ProviderType into NodeFlags

Also removes `ng-reflect` attributes for element properties.
This commit is contained in:
Tobias Bosch
2017-02-27 09:14:18 -08:00
committed by Igor Minar
parent f356041f09
commit 14d37fe052
25 changed files with 326 additions and 340 deletions

View File

@ -10,7 +10,7 @@ import {isDevMode} from '../application_ref';
import {RendererTypeV2, RendererV2} from '../render/api';
import {SecurityContext} from '../security';
import {BindingDef, BindingType, DebugContext, DisposableFn, ElementData, ElementHandleEventFn, NodeData, NodeDef, NodeFlags, NodeType, OutputDef, OutputType, QueryValueType, Services, ViewData, ViewDefinition, ViewDefinitionFactory, ViewFlags, asElementData, asProviderData} from './types';
import {BindingDef, BindingType, DebugContext, DisposableFn, ElementData, ElementHandleEventFn, NodeData, NodeDef, NodeFlags, OutputDef, OutputType, QueryValueType, Services, ViewData, ViewDefinition, ViewDefinitionFactory, ViewFlags, asElementData, asProviderData} from './types';
import {checkAndUpdateBinding, dispatchEvent, elementEventFullName, filterQueryId, getParentRenderElement, resolveViewDefinition, sliceErrorStack, splitMatchedQueriesDsl, splitNamespace} from './util';
const NOOP: any = () => {};
@ -22,13 +22,13 @@ export function anchorDef(
if (!handleEvent) {
handleEvent = NOOP;
}
flags |= NodeFlags.TypeElement;
const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);
// skip the call to sliceErrorStack itself + the call to this function.
const source = isDevMode() ? sliceErrorStack(2, 3) : '';
const template = templateFactory ? resolveViewDefinition(templateFactory) : null;
return {
type: NodeType.Element,
// will bet set by the view definition
index: undefined,
reverseChildIndex: undefined,
@ -54,7 +54,6 @@ export function anchorDef(
},
provider: undefined,
text: undefined,
pureExpression: undefined,
query: undefined,
ngContent: undefined
};
@ -126,10 +125,10 @@ export function elementDef(
componentRendererType = null;
}
if (componentView) {
flags |= NodeFlags.HasComponent;
flags |= NodeFlags.ComponentView;
}
flags |= NodeFlags.TypeElement;
return {
type: NodeType.Element,
// will bet set by the view definition
index: undefined,
reverseChildIndex: undefined,
@ -156,7 +155,6 @@ export function elementDef(
},
provider: undefined,
text: undefined,
pureExpression: undefined,
query: undefined,
ngContent: undefined
};