diff --git a/lib/core_dom/compiler.dart b/lib/core_dom/compiler.dart index 93e94714b..36c2940ed 100644 --- a/lib/core_dom/compiler.dart +++ b/lib/core_dom/compiler.dart @@ -156,7 +156,7 @@ class Compiler { break; case '<=>': mappingFn = (NodeAttrs attrs, Scope scope, Object controller, FilterMap filters, notify()) { - if (attrs[attrName] == null) return; + if (attrs[attrName] == null) return notify(); String expression = attrs[attrName]; Expression expressionFn = _parser(expression); var blockOutbound = false; @@ -193,7 +193,7 @@ class Compiler { break; case '=>': mappingFn = (NodeAttrs attrs, Scope scope, Object controller, FilterMap filters, notify()) { - if (attrs[attrName] == null) return; + if (attrs[attrName] == null) return notify(); Expression attrExprFn = _parser(attrs[attrName]); var shadowValue = null; scope.watch(attrs[attrName], @@ -206,7 +206,7 @@ class Compiler { break; case '=>!': mappingFn = (NodeAttrs attrs, Scope scope, Object controller, FilterMap filters, notify()) { - if (attrs[attrName] == null) return; + if (attrs[attrName] == null) return notify(); Expression attrExprFn = _parser(attrs[attrName]); var watch; watch = scope.watch( diff --git a/test/core_dom/compiler_spec.dart b/test/core_dom/compiler_spec.dart index 0b4d7782b..a62f7630f 100644 --- a/test/core_dom/compiler_spec.dart +++ b/test/core_dom/compiler_spec.dart @@ -786,7 +786,10 @@ class LogComponent { map: const { 'attr-value': '@attrValue', 'expr-value': '<=>exprValue', - 'once-value': '=>!onceValue' + 'once-value': '=>!onceValue', + 'optional-one': '=>optional', + 'optional-two': '<=>optional', + 'optional-once': '=>!optional', } ) class AttachDetachComponent implements NgAttachAware, NgDetachAware, NgShadowRootAware { @@ -795,6 +798,7 @@ class AttachDetachComponent implements NgAttachAware, NgDetachAware, NgShadowRoo String attrValue = 'too early'; String exprValue = 'too early'; String onceValue = 'too early'; + String optional; AttachDetachComponent(Logger this.logger, TemplateLoader templateLoader, Scope this.scope) { logger('new');