refactor: format & lint

This commit is contained in:
Victor Berchet 2016-12-14 13:05:04 -08:00
parent 84400bcc86
commit d4ddb6004e
2 changed files with 13 additions and 15 deletions

View File

@ -576,7 +576,8 @@ function generateDetectChangesMethod(view: CompileView): o.Statement[] {
} }
stmts.push(...view.detectChangesRenderPropertiesMethod.finish()); stmts.push(...view.detectChangesRenderPropertiesMethod.finish());
view.viewChildren.forEach((viewChild) => { view.viewChildren.forEach((viewChild) => {
stmts.push(viewChild.callMethod('internalDetectChanges', [DetectChangesVars.throwOnChange]).toStmt()); stmts.push(
viewChild.callMethod('internalDetectChanges', [DetectChangesVars.throwOnChange]).toStmt());
}); });
const afterViewStmts = const afterViewStmts =
view.updateViewQueriesMethod.finish().concat(view.afterViewLifecycleCallbacksMethod.finish()); view.updateViewQueriesMethod.finish().concat(view.afterViewLifecycleCallbacksMethod.finish());

View File

@ -1135,20 +1135,20 @@ export function main() {
})); }));
it('Detached view can be checked locally', fakeAsync(() => { it('Detached view can be checked locally', fakeAsync(() => {
const ctx = createCompFixture('<wrap-comp-with-ref></wrap-comp-with-ref>'); const ctx = createCompFixture('<wrap-comp-with-ref></wrap-comp-with-ref>');
const cmp: CompWithRef = queryDirs(ctx.debugElement, CompWithRef)[0]; const cmp: CompWithRef = queryDirs(ctx.debugElement, CompWithRef)[0];
cmp.value = 'hello'; cmp.value = 'hello';
cmp.changeDetectorRef.detach(); cmp.changeDetectorRef.detach();
expect(renderLog.log).toEqual([]); expect(renderLog.log).toEqual([]);
ctx.detectChanges(); ctx.detectChanges();
expect(renderLog.log).toEqual([]); expect(renderLog.log).toEqual([]);
cmp.changeDetectorRef.detectChanges(); cmp.changeDetectorRef.detectChanges();
expect(renderLog.log).toEqual(['{{hello}}']); expect(renderLog.log).toEqual(['{{hello}}']);
})); }));
it('Reattaches', fakeAsync(() => { it('Reattaches', fakeAsync(() => {
@ -1364,10 +1364,7 @@ class CompWithRef {
noop() {} noop() {}
} }
@Component({ @Component({selector: 'wrap-comp-with-ref', template: '<comp-with-ref></comp-with-ref>'})
selector: 'wrap-comp-with-ref',
template: '<comp-with-ref></comp-with-ref>'
})
class WrapCompWithRef { class WrapCompWithRef {
constructor(public changeDetectorRef: ChangeDetectorRef) {} constructor(public changeDetectorRef: ChangeDetectorRef) {}
} }