angular-cn/packages/forms/src/directives/control_container.ts

40 lines
924 B
TypeScript
Raw Normal View History

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
2016-06-08 15:36:24 -07:00
import {AbstractControlDirective} from './abstract_control_directive';
import {Form} from './form_interface';
2016-06-08 15:36:24 -07:00
/**
* @description
* A base class for directives that contain multiple registered instances of `NgControl`.
2016-06-08 15:36:24 -07:00
* Only used by the forms module.
*
* @publicApi
2016-06-08 15:36:24 -07:00
*/
export abstract class ControlContainer extends AbstractControlDirective {
/**
* @description
* The name for the control
*/
// TODO(issue/24571): remove '!'.
name !: string | number | null;
2016-06-08 15:36:24 -07:00
/**
* @description
* The top-level form directive for the control.
2016-06-08 15:36:24 -07:00
*/
get formDirective(): Form|null { return null; }
2016-06-08 15:36:24 -07:00
/**
* @description
* The path to this group.
2016-06-08 15:36:24 -07:00
*/
get path(): string[]|null { return null; }
2016-06-08 15:36:24 -07:00
}