Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 78be220

Browse files
committed
Adding recluse form to work around angular bug
1 parent 84c8d5c commit 78be220

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-angular-components",
3-
"version": "4.1.7",
3+
"version": "4.2.1",
44
"description": "Reusable responsive angular components",
55
"author": "Renovo Development Team",
66
"keywords": [

source/components/form/RecluseForm.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Component, forwardRef } from '@angular/core';
2+
import { FormGroup } from '@angular/forms';
3+
4+
import { FormComponent } from '../form/form';
5+
6+
@Component({
7+
selector: 'rlRecluseForm',
8+
template: '<ng-content></ng-content>',
9+
providers: [
10+
{
11+
provide: FormComponent,
12+
useExisting: forwardRef(() => RecluseFormComponent),
13+
},
14+
],
15+
})
16+
export class RecluseFormComponent {
17+
form = new FormGroup({});
18+
}

source/components/form/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { FormComponent } from './form';
22
import { INPUT_DIRECTIVES } from '../inputs/index';
33
import { AutosaveDirective } from '../../behaviors/autosave/autosave';
4+
import { RecluseFormComponent } from './RecluseForm';
45

5-
export const FORM_DIRECTIVES = [FormComponent, INPUT_DIRECTIVES, AutosaveDirective];
6+
export const FORM_DIRECTIVES = [FormComponent, INPUT_DIRECTIVES, AutosaveDirective, RecluseFormComponent];
67

78
export * from './form';

source/ui.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { ButtonModule } from'./components/buttons/button.module';
99
import { CARD_CONTAINER_DIRECTIVES } from'./components/cardContainer/index';
1010
import { CommaListComponent } from'./components/commaList/commaList';
1111
import { DIALOG_DIRECTIVES } from'./components/dialog/index';
12+
import { RecluseFormComponent } from'./components/form/RecluseForm';
1213
import { FormComponent } from'./components/form/form';
1314
import { INPUT_DIRECTIVES } from'./components/inputs/index';
1415
import { MultiStepIndicatorComponent } from'./components/multiStepIndicator/multiStepIndicator';
@@ -41,6 +42,7 @@ export const componentsList: any[] = [
4142
CARD_CONTAINER_DIRECTIVES,
4243
CommaListComponent,
4344
DIALOG_DIRECTIVES,
45+
RecluseFormComponent,
4446
FormComponent,
4547
INPUT_DIRECTIVES,
4648
MultiStepIndicatorComponent,

0 commit comments

Comments
 (0)