feat(ivy): support host attributes (#22213)

PR Close #22213
This commit is contained in:
Kara Erickson
2018-02-16 12:09:47 -08:00
committed by Victor Berchet
parent 6b627f67db
commit 49082d7ab2
4 changed files with 60 additions and 1 deletions

View File

@ -910,6 +910,12 @@ export function directiveCreate<T>(
diPublic(directiveDef !);
}
if (directiveDef !.attributes != null &&
(previousOrParentNode.flags & LNodeFlags.TYPE_MASK) == LNodeFlags.Element) {
setUpAttributes(
(previousOrParentNode as LElementNode).native, directiveDef !.attributes as string[]);
}
const tNode: TNode|null = previousOrParentNode.tNode !;
if (tNode && tNode.attrs) {
setInputsFromAttrs<T>(instance, directiveDef !.inputs, tNode);