#755 placeholders support

This commit is contained in:
Denys Vuika
2016-11-21 14:54:44 +00:00
committed by Mario Romano
parent 96ce41fcec
commit 7ea09bbde0
20 changed files with 57 additions and 138 deletions

View File

@@ -1,7 +1,8 @@
<div class="mdl-grid" *ngIf="field?.isVisible" id="data-widget">
<div class="mdl-cell mdl-cell--11-col">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label date-widget"
<div class="mdl-textfield mdl-js-textfield date-widget"
[class.date-widget__invalid]="!field.isValid">
<label [attr.for]="field.id">{{field.name}}</label>
<input class="mdl-textfield__input"
type="text"
[attr.id]="field.id"
@@ -9,8 +10,8 @@
[(ngModel)]="field.value"
(ngModelChange)="onDateChanged()"
(onOk)="onDateSelected()"
[disabled]="field.readOnly">
<label class="mdl-textfield__label" [attr.for]="field.id">{{field.name}} (d-M-yyyy)</label>
[disabled]="field.readOnly"
placeholder="{{field.placeholder}}">
<span *ngIf="field.validationSummary" class="mdl-textfield__error">{{field.validationSummary}}</span>
</div>
</div>

View File

@@ -16,7 +16,7 @@
*/
import { Component, ElementRef, OnInit, AfterViewChecked } from '@angular/core';
import { TextFieldWidgetComponent } from './../textfield-widget.component';
import { WidgetComponent } from './../widget.component';
@Component({
moduleId: module.id,
@@ -24,14 +24,14 @@ import { TextFieldWidgetComponent } from './../textfield-widget.component';
templateUrl: './date.widget.html',
styleUrls: ['./date.widget.css']
})
export class DateWidget extends TextFieldWidgetComponent implements OnInit, AfterViewChecked {
export class DateWidget extends WidgetComponent implements OnInit, AfterViewChecked {
DATE_FORMAT: string = 'D-M-YYYY';
datePicker: any;
constructor(elementRef: ElementRef) {
super(elementRef);
constructor(private elementRef: ElementRef) {
super();
}
ngOnInit() {