src/question/text.model.ts
Properties |
|
Methods |
|
constructor(name: string, description: string, dependencies: Dependency[], answer: Answer | string, validations: Validation[], disabled: boolean, mask: string, placeholder: string)
|
||||||||||||||||||||||||||||||||||||
Defined in src/question/text.model.ts:18
|
||||||||||||||||||||||||||||||||||||
Parameters :
|
Public fromJson | ||||||||
fromJson(question: Text)
|
||||||||
Defined in src/question/text.model.ts:7
|
||||||||
Parameters :
Returns :
Text
|
Public mask |
mask:
|
Type : string
|
Defined in src/question/text.model.ts:27
|
Public placeholder |
placeholder:
|
Type : string
|
Defined in src/question/text.model.ts:28
|
import { Answer, Dependency, Question, QuestionType } from '.';
import { Validation } from '../validation';
import { AnswerFactory, ValidationFactory } from '../factory';
export class Text extends Question<string> {
public static fromJson(question: Text): Text {
return new Text(
question.name,
question.description,
question.dependencies,
AnswerFactory.create<string>(question.answer),
ValidationFactory.createValidationList(question.validations),
question.disabled,
question.mask,
question.placeholder
);
}
public constructor(
name: string,
description: string,
dependencies: Dependency[] = [],
answer: Answer<string> | string = null,
validations: Validation[] = [],
disabled: boolean = false,
public mask: string = null,
public placeholder: string = null,
) {
super(name, description, QuestionType.TEXT, dependencies, answer, validations, disabled);
}
}