diff --git a/modules/angular2/src/transform/template_compiler/change_detector_codegen.dart b/modules/angular2/src/transform/template_compiler/change_detector_codegen.dart index 2ad4a9e409..2916382e77 100644 --- a/modules/angular2/src/transform/template_compiler/change_detector_codegen.dart +++ b/modules/angular2/src/transform/template_compiler/change_detector_codegen.dart @@ -303,6 +303,10 @@ class _CodegenState { rhs = '$context.${r.name}'; break; + case RECORD_TYPE_SAFE_PROPERTY: + rhs = '${_UTIL}.isValueBlank(${context}) ? null : ${context}.${r.name}'; + break; + case RECORD_TYPE_LOCAL: rhs = '$_LOCALS_ACCESSOR.get("${r.name}")'; break; @@ -311,6 +315,11 @@ class _CodegenState { rhs = '$context.${r.name}($argString)'; break; + case RECORD_TYPE_SAFE_INVOKE_METHOD: + rhs = '${_UTIL}.isValueBlank(${context}) ' + '? null : ${context}.${r.name}(${argString})'; + break; + case RECORD_TYPE_INVOKE_CLOSURE: rhs = '$context($argString)'; break;