mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
e86a1d3441
Turns on the `strict` compiler flag and resolves the compilation errors in the various AIO examples. PR Close #41999
32 lines
807 B
TypeScript
32 lines
807 B
TypeScript
// #docregion
|
|
export class QuestionBase<T> {
|
|
value: T|undefined;
|
|
key: string;
|
|
label: string;
|
|
required: boolean;
|
|
order: number;
|
|
controlType: string;
|
|
type: string;
|
|
options: {key: string, value: string}[];
|
|
|
|
constructor(options: {
|
|
value?: T;
|
|
key?: string;
|
|
label?: string;
|
|
required?: boolean;
|
|
order?: number;
|
|
controlType?: string;
|
|
type?: string;
|
|
options?: {key: string, value: string}[];
|
|
} = {}) {
|
|
this.value = options.value;
|
|
this.key = options.key || '';
|
|
this.label = options.label || '';
|
|
this.required = !!options.required;
|
|
this.order = options.order === undefined ? 1 : options.order;
|
|
this.controlType = options.controlType || '';
|
|
this.type = options.type || '';
|
|
this.options = options.options || [];
|
|
}
|
|
}
|