diff --git a/src/generators/dom/preprocess.js b/src/generators/dom/preprocess.js index 62ee632a62..d6f1d08e42 100644 --- a/src/generators/dom/preprocess.js +++ b/src/generators/dom/preprocess.js @@ -82,7 +82,22 @@ const preprocessors = { }, Element: ( generator, block, node ) => { - // TODO attributes and bindings (and refs?)... + node.attributes.forEach( attribute => { + if ( attribute.type === 'Attribute' && attribute.value !== true ) { + attribute.value.forEach( chunk => { + if ( chunk.type !== 'Text' ) { + const { dependencies } = block.contextualise( chunk.expression ); + block.addDependencies( dependencies ); + } + }); + } + + else if ( attribute.type === 'Binding' ) { + const { dependencies } = block.contextualise( attribute.value ); + block.addDependencies( dependencies ); + } + }); + preprocessChildren( generator, block, node.children ); } };