First custom Dynamic Form Module generation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {Component, Inject} from '@angular/core';
|
||||
import {QuestionInterface} from './modules/dyn-form/types/question.interface';
|
||||
import {QuestionService} from './modules/dyn-form/services/question.service';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
@@ -7,26 +8,14 @@ import {QuestionInterface} from './modules/dyn-form/types/question.interface';
|
||||
})
|
||||
|
||||
export class AppComponent {
|
||||
public resultCounter = 10;
|
||||
public resultTag = {"alpha": true, "beta": false};
|
||||
public resultTag2 = {"alpha": true, "beta": false};
|
||||
public formQuestions: QuestionInterface[] = [];
|
||||
|
||||
public formQuestions: QuestionInterface[] = [
|
||||
{
|
||||
type: "flag",
|
||||
description: "This is a help tooltip",
|
||||
properties: {
|
||||
key: "flags",
|
||||
label: "Form Type Flags",
|
||||
order: 1,
|
||||
constructor(private questionService: QuestionService) {
|
||||
this.questionService.getQuestions((res, err) => {
|
||||
this.formQuestions = res;
|
||||
});
|
||||
}
|
||||
|
||||
// dropdown && flags
|
||||
options: [{key: "alpha", value: "A"}, {key: "beta", value: "B"}]
|
||||
}, constraints: {
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
submit(value: any) {
|
||||
console.log("send", value);
|
||||
|
||||
Reference in New Issue
Block a user