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