src/question/select.model.ts
Properties |
|
Methods |
|
constructor(name: string, description: string, dependencies: Dependency[], answer: Answer | string, validations: Validation[], disabled: boolean, options: [] | [], defaultOption: string, editableOption: string, placeholder: string)
|
||||||||||||||||||||||||||||||||||||||||||||
Defined in src/question/select.model.ts:20
|
||||||||||||||||||||||||||||||||||||||||||||
Parameters :
|
Public fromJson | ||||||||
fromJson(question: Select)
|
||||||||
Defined in src/question/select.model.ts:7
|
||||||||
Parameters :
Returns :
Select
|
Public editableOption |
editableOption:
|
Type : string
|
Defined in src/question/select.model.ts:31
|
Public placeholder |
placeholder:
|
Type : string
|
Defined in src/question/select.model.ts:32
|
import { Answer, Choice, Dependency, Option, QuestionType } from '.';
import { Validation } from '../validation';
import { AnswerFactory, ValidationFactory } from '../factory';
export class Select extends Choice {
public static fromJson(question: Select): Select {
return new Select(
question.name,
question.description,
question.dependencies,
AnswerFactory.create<string>(question.answer),
ValidationFactory.createValidationList(question.validations),
question.disabled,
question.options,
question.defaultOption,
question.editableOption,
question.placeholder
);
}
public constructor(
name: string,
description: string,
dependencies: Dependency[] = [],
answer: Answer<string> | string = null,
validations: Validation[] = [],
disabled: boolean = false,
options: Option[] | string[] = [],
defaultOption: string = null,
public editableOption: string = null,
public placeholder: string = null
) {
super(name, description, QuestionType.SELECT, dependencies, answer, validations, disabled, options, defaultOption);
}
}