feat(change_detection): added an experimental support for observables

This commit is contained in:
vsavkin
2015-08-17 15:28:37 -07:00
committed by Victor Savkin
parent ed81cb94b0
commit cbfc9cb344
18 changed files with 243 additions and 44 deletions

View File

@ -100,7 +100,7 @@ class _CodegenState {
var protoRecords = createPropertyRecords(def);
var eventBindings = createEventRecords(def);
var names = new CodegenNameUtil(protoRecords, eventBindings, def.directiveRecords, _UTIL);
var logic = new CodegenLogicUtil(names, _UTIL);
var logic = new CodegenLogicUtil(names, _UTIL, def.strategy);
return new _CodegenState._(
def.id,
typeName,
@ -193,7 +193,7 @@ class _CodegenState {
String _genMarkPathToRootAsCheckOnce(ProtoRecord r) {
var br = r.bindingRecord;
if (br.isOnPushChangeDetection()) {
if (!br.isDefaultChangeDetection()) {
return "${_names.getDetectorName(br.directiveRecord.directiveIndex)}.markPathToRootAsCheckOnce();";
} else {
return "";
@ -469,7 +469,7 @@ class _CodegenState {
String _genNotifyOnPushDetectors(ProtoRecord r) {
var br = r.bindingRecord;
if (!r.lastInDirective || !br.isOnPushChangeDetection()) return '';
if (!r.lastInDirective || br.isDefaultChangeDetection()) return '';
return '''
if($_IS_CHANGED_LOCAL) {
${_names.getDetectorName(br.directiveRecord.directiveIndex)}.markAsCheckOnce();