feat(dart/transform): Add onInit and onCheck hooks in Dart

Implement `onInit` and `onCheck` hooks in pre-generated Dart change
detectors. This mirrors the changes made to the JIT change detector in
c39c8ebcd0.
This commit is contained in:
Tim Blasi
2015-06-09 15:39:48 -07:00
parent 633cf63682
commit 17c6d6a92d
3 changed files with 51 additions and 18 deletions

View File

@ -236,7 +236,7 @@ export class ChangeDetectorJITGenerator {
} else {
rec = this._genReferenceCheck(r);
}
return `${rec}${this._genLastInDirective(r)}`;
return `${rec}${this._maybeGenLastInDirective(r)}`;
}
_genDirectiveLifecycle(r: ProtoRecord) {
@ -419,7 +419,7 @@ export class ChangeDetectorJITGenerator {
`;
}
_genLastInDirective(r: ProtoRecord): string {
_maybeGenLastInDirective(r: ProtoRecord): string {
if (!r.lastInDirective) return "";
return `
${CHANGES_LOCAL} = null;