Skip to content

Commit

Permalink
minor template improvements (closes #214)
Browse files Browse the repository at this point in the history
  • Loading branch information
udos86 committed Dec 20, 2016
1 parent c7b3902 commit 109464c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 23 deletions.
62 changes: 45 additions & 17 deletions example/app/basic/basic-example.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,49 @@ export const BASIC_EXAMPLE_MODEL = [

export const BASIC_EXAMPLE_ARRAY_MODEL = [

new DynamicFormArrayModel({

id: "basicFormArray",
initialCount: 5,
label: "Example Array Model",
createGroup: () => {
return [
new DynamicInputModel(
{
id: "basicArrayGroupInput",
label: "Example Array Group Input",
placeholder: "example array group input"
}
)
];
}
})
new DynamicFormArrayModel(
{
id: "basicFormArray",
initialCount: 2,
label: "Example Array Model",
createGroup: () => {
return [
new DynamicCheckboxModel({

label: "Mon",
id: "monday"
}),
new DynamicCheckboxModel({

label: "Tue",
id: "tuesday"
}),
new DynamicCheckboxModel({

label: "Wen",
id: "wednesday"
}),
new DynamicCheckboxModel({

label: "Thu",
id: "thursday"
}),
new DynamicCheckboxModel({

label: "Fri",
id: "friday"
}),
new DynamicCheckboxModel({

label: "Sat",
id: "saturday"
}),
new DynamicCheckboxModel({

label: "Sun",
id: "sunday"
})
];
}
})
];
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[value]="model.value"
(blur)="onFocusChange($event)"
(change)="onValueChange($event)"
(focus)="onFocusChange($event)"/><span [innerHTML]="model.label"></span></label>
(focus)="onFocusChange($event)"/><span *ngIf="model.label" [innerHTML]="model.label"></span></label>
</div>

</div>
Expand Down Expand Up @@ -182,7 +182,7 @@
(focus)="onFocusChange($event)"></textarea>


<span *ngIf="model.hint" class="help-block" [innerHTML]="model.hint"></span>
<span *ngIf="model.hint" class="help-block" [ngClass]="model.cls.element.hint" [innerHTML]="model.hint"></span>

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
[value]="model.value"
(blur)="onFocusChange($event)"
(change)="onValueChange($event)"
(focus)="onFocusChange($event)"/><span [innerHTML]="model.label"></span></label>
(focus)="onFocusChange($event)"/><span *ngIf="model.label" [innerHTML]="model.label"></span></label>


<div *ngIf="model.type === 'INPUT'" class="input-group">
Expand Down Expand Up @@ -197,7 +197,7 @@
(change)="onValueChange($event)"
(focus)="onFocusChange($event)"></textarea>

<p *ngIf="model.hint" class="help-text" [innerHTML]="model.hint"></p>
<p *ngIf="model.hint" class="help-text" [ngClass]="model.cls.element.hint" [innerHTML]="model.hint"></p>

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
[ngClass]="model.cls.element.control"
(blur)="onFocusChange($event)"
(change)="onValueChange($event)"
(focus)="onFocusChange($event)"><span [innerHTML]="model.label"></span></md-checkbox>
(focus)="onFocusChange($event)"><span *ngIf="model.label" [innerHTML]="model.label"></span></md-checkbox>


<md-input *ngIf="model.type === 'INPUT'"
Expand Down
2 changes: 1 addition & 1 deletion modules/ui-primeng/src/dynamic-form-primeng.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
</div>


<div *ngIf="model.type === 'CHECKBOX'" [ngClass]="model.cls.grid.label">
<div *ngIf="model.type === 'CHECKBOX' && model.label" [ngClass]="model.cls.grid.label">

<label [attr.for]="model.id" [innerHTML]="model.label" [ngClass]="model.cls.element.label"></label>

Expand Down

0 comments on commit 109464c

Please sign in to comment.