src/question/question.model.ts
Properties |
|
Methods |
|
constructor(name: string, description: string, type: QuestionType, dependencies: Dependency[], answer: Answer | AnswerType, validations: Validation[], disabled: boolean)
|
||||||||||||||||||||||||||||||||
Defined in src/question/question.model.ts:4
|
||||||||||||||||||||||||||||||||
Parameters :
|
Public isRequired |
isRequired()
|
Defined in src/question/question.model.ts:16
|
Returns :
boolean
|
Public answer |
answer:
|
Type : Answer | AnswerType
|
Defined in src/question/question.model.ts:11
|
Public dependencies |
dependencies:
|
Type : Dependency[]
|
Defined in src/question/question.model.ts:10
|
Public description |
description:
|
Type : string
|
Defined in src/question/question.model.ts:8
|
Public disabled |
disabled:
|
Type : boolean
|
Default value : false
|
Defined in src/question/question.model.ts:13
|
Public name |
name:
|
Type : string
|
Defined in src/question/question.model.ts:7
|
Public type |
type:
|
Type : QuestionType
|
Defined in src/question/question.model.ts:9
|
Public validations |
validations:
|
Type : Validation[]
|
Defined in src/question/question.model.ts:12
|
import { Answer, Dependency, QuestionType } from '.';
import { Pattern, Validation, ValidationType } from '../validation';
export abstract class Question<AnswerType> {
public constructor(
public name: string,
public description: string,
public type: QuestionType,
public dependencies: Dependency[] = [],
public answer: Answer<AnswerType> | AnswerType = null,
public validations: Validation[] = [],
public disabled: boolean = false
) { }
public isRequired(): boolean {
for (const validation of this.validations) {
if (validation.isRequired()) {
return true;
}
}
return false;
}
}