Skip to content

Commit 360ddb6

Browse files
committed
Add ability to pass template refs along with form component, this allows for building proxying form components. Add support for the input event on input controls to support use cases such as characters left
1 parent 5941513 commit 360ddb6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

projects/ng-dynamic-forms/ui-ng-bootstrap/src/lib/dynamic-ng-bootstrap-form.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ export class DynamicNGBootstrapFormComponent extends DynamicFormComponent {
3535
@Output() focus: EventEmitter<DynamicFormControlEvent> = new EventEmitter<DynamicFormControlEvent>();
3636

3737
@Output() ngbEvent: EventEmitter<DynamicFormControlEvent> = new EventEmitter<DynamicFormControlEvent>();
38-
39-
@ContentChildren(DynamicTemplateDirective) templates: QueryList<DynamicTemplateDirective>;
38+
@Input("templates") inputTemplateList: QueryList<DynamicTemplateDirective>;
39+
@ContentChildren(DynamicTemplateDirective) contentTemplateList: QueryList<DynamicTemplateDirective>;
4040

4141
@ViewChildren(DynamicNGBootstrapFormControlContainerComponent) components: QueryList<DynamicNGBootstrapFormControlContainerComponent>;
4242

43+
get templates(): QueryList<DynamicTemplateDirective> | undefined {
44+
return this.inputTemplateList !== undefined ? this.inputTemplateList : this.contentTemplateList;
45+
}
46+
4347
constructor(protected changeDetectorRef: ChangeDetectorRef,
4448
protected componentService: DynamicFormComponentService) {
4549
super(changeDetectorRef, componentService);

projects/ng-dynamic-forms/ui-ng-bootstrap/src/lib/input/dynamic-ng-bootstrap-input.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
[type]="model.inputType"
3232
(blur)="onBlur($event)"
3333
(change)="onChange($event)"
34+
(input)="onChange($event)"
3435
(focus)="onFocus($event)"/>
3536

3637
<div *ngIf="model.suffix" class="input-group-append">

0 commit comments

Comments
 (0)