|
@@ -100,7 +100,7 @@ export interface FormAndMeta {
|
|
|
}
|
|
|
|
|
|
export interface Callbacks {
|
|
|
- [index: string]: () => void
|
|
|
+ [index: string]: () => void;
|
|
|
}
|
|
|
|
|
|
@Injectable()
|
|
@@ -117,7 +117,7 @@ export class DynaformService {
|
|
|
}
|
|
|
|
|
|
setBuildStrategy(str): void {
|
|
|
- switch(str.toUpperCase()) {
|
|
|
+ switch (str.toUpperCase()) {
|
|
|
case 'MODELFIRST': // Build from model, combining optional extra metadata
|
|
|
case 'METAFIRST': // Build from metadata, sourcing values from the model (usindg meta's 'source' attribute)
|
|
|
this.buildStrategy = str.toUpperCase();
|
|
@@ -126,7 +126,7 @@ export class DynaformService {
|
|
|
throw new Error(`DYNAFORM: Unknown Build Strategy ${str} - should be MODELFIRST or METAFIRST`);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
build(model: StringMap, meta = {}, createFromMeta = false): FormAndMeta {
|
|
|
// Short name for autoBuildFormGroupAndMeta
|
|
|
return this.autoBuildFormGroupAndMeta(model, meta, createFromMeta);
|
|
@@ -140,13 +140,12 @@ export class DynaformService {
|
|
|
Object.assign(this.callbacks, callbacks);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
call(fnId: string) {
|
|
|
// Handle callback events
|
|
|
try {
|
|
|
this.callbacks[fnId]();
|
|
|
- }
|
|
|
- catch(e) {
|
|
|
+ } catch (e) {
|
|
|
console.error('Dynaform has no registered callback for', fnId);
|
|
|
console.error(e);
|
|
|
}
|