### File

`src/question/radio.model.ts`

### Extends

`Choice`

### Index

###### Methods
Public fromJson

### Constructor

`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 :
Name | Type | Optional | Description
name | `string` |  |
description | `string` |  |
dependencies | `Dependency[]` |  |
answer | `Answer | string` |  |
validations | `Validation[]` |  |
disabled | `boolean` |  |
options | `[] | []` |  |
defaultOption | `string` |  |

### Methods

Public fromJson
`fromJson(question: Radio)`
Defined in src/question/radio.model.ts:7
Parameters :
Name | Type | Optional | Description
question | `Radio` |  |
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);
      }
    }

# results matching ""

# No results matching ""