Added Dropdown and Hidden Input
This commit is contained in:
@@ -1,34 +1,57 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {Component} from '@angular/core';
|
||||
import {QuestionInterface} from './modules/dyn-form/types/question.interface';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
||||
export class AppComponent {
|
||||
public resultCounter = 10;
|
||||
public resultTag = {"alpha": true, "beta": false};
|
||||
public resultTag2 = {"alpha": true, "beta": false};
|
||||
|
||||
export class AppComponent {
|
||||
public formQuestions: QuestionInterface[] = [
|
||||
{
|
||||
type: "flag",
|
||||
description: "This is a help tooltip",
|
||||
type: 'flag',
|
||||
description: 'This is a help tooltip',
|
||||
properties: {
|
||||
key: "flags",
|
||||
label: "Form Type Flags",
|
||||
key: 'flags',
|
||||
label: 'Form Type Flags',
|
||||
order: 1,
|
||||
|
||||
// dropdown && flags
|
||||
options: [{key: "alpha", value: "A"}, {key: "beta", value: "B"}]
|
||||
options: [{key: 'alpha', value: 'A'}, {key: 'beta', value: 'B'}, {key: 'gamma', value: 'C'}, {key: 'delta', value: 'D'}]
|
||||
}, constraints: {
|
||||
optional: true
|
||||
optional: true
|
||||
}
|
||||
}, {
|
||||
type: 'dropdown',
|
||||
description: 'Cool dropdown',
|
||||
properties: {
|
||||
key: 'cooldrop',
|
||||
label: 'Dropdown',
|
||||
order: 2,
|
||||
methods: ['insert'],
|
||||
|
||||
// dropdown
|
||||
options: [{key: 'hello', value: 'Hallo'}, {key: 'world', value: 'World'}, {key: 'and', value: 'And'}, {key: 'u', value: 'You'}]
|
||||
}, constraints: {
|
||||
optional: false
|
||||
}
|
||||
}, {
|
||||
type: 'hidden',
|
||||
description: 'ID',
|
||||
properties: {
|
||||
key: 'ID',
|
||||
order: 3
|
||||
}, constraints: {
|
||||
optional: false
|
||||
}
|
||||
}
|
||||
];
|
||||
public formValue = {
|
||||
flags: {gamma: true},
|
||||
ID: 5,
|
||||
cooldrop: 'u'
|
||||
};
|
||||
|
||||
submit(value: any) {
|
||||
console.log("send", value);
|
||||
console.log('send', value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user