Skip to content

Commit

Permalink
Update also material design input
Browse files Browse the repository at this point in the history
  • Loading branch information
George Oakling committed Jul 21, 2017
1 parent 9c93e67 commit 3d6bae7
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 5 deletions.
Empty file modified src/demo/app/example-schemas.model.ts
100644 → 100755
Empty file.
Empty file modified src/demo/assets/example-schemas/ng2jsf-flex-layout.json
100644 → 100755
Empty file.
Empty file modified src/demo/assets/example-schemas/ng2jsf-json-schema-draft06.json
100644 → 100755
Empty file.
Empty file modified src/demo/environments/environment.prod.ts
100644 → 100755
Empty file.
Empty file modified src/demo/environments/environment.ts
100644 → 100755
Empty file.
Empty file modified src/demo/favicon.ico
100644 → 100755
Empty file.
Empty file modified src/demo/index.html
100644 → 100755
Empty file.
Empty file modified src/demo/polyfills.ts
100644 → 100755
Empty file.
Empty file modified src/demo/styles.scss
100644 → 100755
Empty file.
Empty file modified src/demo/test.ts
100644 → 100755
Empty file.
Empty file modified src/demo/tsconfig.app.json
100644 → 100755
Empty file.
Empty file modified src/lib/angular2-json-schema-form.ts
100644 → 100755
Empty file.
Empty file modified src/lib/index.ts
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import { JsonSchemaFormService } from '../../json-schema-form.service';
[required]="options?.required"
[style.width]="'100%'"
[type]="layoutNode?.type"
[value]="controlValue"
(input)="updateValue($event)">
[ngModel]="inputValue"
(ngModelChange)="updateInputValue($event)">
<span *ngIf="options?.fieldAddonLeft"
md-prefix>{{options?.fieldAddonLeft}}</span>
<span *ngIf="options?.fieldAddonRight"
Expand All @@ -37,7 +37,8 @@ import { JsonSchemaFormService } from '../../json-schema-form.service';
export class MaterialInputComponent implements OnInit {
formControl: AbstractControl;
controlName: string;
controlValue: any;
private userInput: boolean = true;
public inputValue: string;
controlDisabled: boolean = false;
boundControl: boolean = false;
options: any;
Expand All @@ -56,7 +57,21 @@ export class MaterialInputComponent implements OnInit {
this.jsf.initializeControl(this);
}

updateValue(event) {
this.jsf.updateValue(this, event.target.value);
get controlValue(){
console.log(this.inputValue);
return this.inputValue;
}

set controlValue(value: string){
this.userInput = false;
this.updateInputValue(value);
this.userInput = true;
}

public updateInputValue (value: string) {
this.inputValue = value;
if (this.userInput){
this.jsf.updateValue(this, value);
}
}
}
Empty file modified src/lib/tsconfig.es5.json
100644 → 100755
Empty file.
Empty file modified src/lib/tsconfig.json
100644 → 100755
Empty file.
Empty file modified src/lib/tsconfig.spec.json
100644 → 100755
Empty file.
Empty file modified src/lib/typings.d.ts
100644 → 100755
Empty file.

0 comments on commit 3d6bae7

Please sign in to comment.