Skip to content

Commit

Permalink
fix: fixes #22
Browse files Browse the repository at this point in the history
  • Loading branch information
jscharett committed Sep 2, 2019
1 parent 6141493 commit 7844e73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { AbstractWidget } from '../widget/widget';
const widgets: Map<string, typeof AbstractWidget> = new Map<string, typeof AbstractWidget>();

/** Internal method for registering a widget with the widget library */
export const register = (component: typeof AbstractWidget, types: Array<string>): void => {
export function register(component: typeof AbstractWidget, types: Array<string>): void {
types.forEach((type: string) => {
if (widgets.has(type)) {
console.error(`Widget type "${type}" already exists. Ignoring.`, component);
} else {
widgets.set(type, component);
}
});
};
}

/**
* Provides services for mapping a widget component to a layoutNode type
Expand Down
4 changes: 1 addition & 3 deletions projects/ngx-json-schema-form/src/lib/form/form.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { JsonSchemaFormComponent } from './json-schema-form.component';
@NgModule({
declarations: [ JsonSchemaFormComponent ],
exports: [ JsonSchemaFormComponent ],
imports: [
CommonModule, SelectWidgetModule
]
imports: [ CommonModule, SelectWidgetModule ]
})
export class FormModule { }

0 comments on commit 7844e73

Please sign in to comment.