From 534db7fe2b5d995d3b8c4db97f3e00cf15a3a867 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Wed, 28 Oct 2015 16:56:14 -0700 Subject: [PATCH] cleanup(forms): marks abstract classes as abstract --- .../src/core/forms/directives/abstract_control_directive.ts | 5 +++-- modules/angular2/src/core/forms/directives/ng_control.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/angular2/src/core/forms/directives/abstract_control_directive.ts b/modules/angular2/src/core/forms/directives/abstract_control_directive.ts index 235816ebac..05fe23bc0b 100644 --- a/modules/angular2/src/core/forms/directives/abstract_control_directive.ts +++ b/modules/angular2/src/core/forms/directives/abstract_control_directive.ts @@ -1,8 +1,9 @@ import {AbstractControl} from '../model'; import {isPresent} from 'angular2/src/core/facade/lang'; +import {unimplemented} from 'angular2/src/core/facade/exceptions'; -export class AbstractControlDirective { - get control(): AbstractControl { return null; } +export abstract class AbstractControlDirective { + get control(): AbstractControl { return unimplemented(); } get value(): any { return isPresent(this.control) ? this.control.value : null; } diff --git a/modules/angular2/src/core/forms/directives/ng_control.ts b/modules/angular2/src/core/forms/directives/ng_control.ts index a2574aabca..cc175b7bd8 100644 --- a/modules/angular2/src/core/forms/directives/ng_control.ts +++ b/modules/angular2/src/core/forms/directives/ng_control.ts @@ -10,11 +10,11 @@ import {unimplemented} from 'angular2/src/core/facade/exceptions'; // an abstract method in the public API, and we cannot reflect // on that in Dart due to https://github.com/dart-lang/sdk/issues/18721 // Also we don't have abstract setters, see https://github.com/Microsoft/TypeScript/issues/4669 -export class NgControl extends AbstractControlDirective { +export abstract class NgControl extends AbstractControlDirective { name: string = null; valueAccessor: ControlValueAccessor = null; get validator(): Function { return unimplemented(); } - viewToModelUpdate(newValue: any): void { return unimplemented(); } + abstract viewToModelUpdate(newValue: any): void; }