First custom Dynamic Form Module generation
This commit is contained in:
29
src/app/modules/dyn-form/services/question.service.ts
Normal file
29
src/app/modules/dyn-form/services/question.service.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {HttpCachedService} from '../../../services/http-cached.service';
|
||||
import {QuestionInterface} from '../types/question.interface';
|
||||
|
||||
@Injectable()
|
||||
export class QuestionService {
|
||||
constructor(private httpCachedService: HttpCachedService) {
|
||||
|
||||
}
|
||||
public getQuestions(cb: (res: QuestionInterface[], err: any) => void) {
|
||||
setTimeout(() => cb([
|
||||
{
|
||||
type: "flag",
|
||||
description: "This is a help tooltip",
|
||||
properties: {
|
||||
key: "flags",
|
||||
label: "Form Type Flags",
|
||||
order: 1,
|
||||
|
||||
// dropdown && flags
|
||||
options: [{key: "alpha", value: "A"}, {key: "beta", value: "B"}]
|
||||
},
|
||||
constraints: {
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
], null), 4000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user