Created
June 22, 2017 17:54
-
-
Save ajcrites/7808acecae7d02f0fab121ecddf135a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [1;32mdiff --git a/src/app/password/password.component.ts b/src/app/password/password.component.ts[0;0m | |
| [1;37mindex b430b39..d45eba9 100644[0;0m | |
| [1;31m--- a/src/app/password/password.component.ts[0;0m | |
| [1;34m+++ b/src/app/password/password.component.ts[0;0m | |
| [1;35m@@ -1,5 +1,5 @@[0;0m | |
| [1;31m-import { Component, ViewChild, Input, Output, forwardRef, EventEmitter } from '@angular/core';[0;0m | |
| [1;31m-import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';[0;0m | |
| [1;34m+import { Component, ViewChild, Input, Output, EventEmitter } from '@angular/core';[0;0m | |
| [1;34m+import { FormControl } from '@angular/forms';[0;0m | |
| [1;37m [0;0m | |
| [1;37m import { Platform } from 'ionic-angular';[0;0m | |
| [1;37m [0;0m | |
| [1;35m@@ -10,21 +10,18 @@ import { rgb } from 'csx';[0;0m | |
| [1;37m @Component({[0;0m | |
| [1;37m selector: 'tcp-password',[0;0m | |
| [1;37m templateUrl: 'password.html',[0;0m | |
| [1;31m- providers: [[0;0m | |
| [1;31m- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => PasswordComponent), multi: true }[0;0m | |
| [1;31m- ][0;0m | |
| [1;37m })[0;0m | |
| [1;31m-export class PasswordComponent implements ControlValueAccessor {[0;0m | |
| [1;34m+export class PasswordComponent {[0;0m | |
| [1;37m @ViewChild('passwordField') passwordField;[0;0m | |
| [1;37m [0;0m | |
| [1;37m @Input() label = 'ACCOUNT.LABELS.PASSWORD';[0;0m | |
| [1;34m+ @Input() control: FormControl;[0;0m | |
| [1;37m @Input() wrapperCss: string;[0;0m | |
| [1;37m @Input() inputCss: string;[0;0m | |
| [1;37m @Input() labelCss: string;[0;0m | |
| [1;37m [0;0m | |
| [1;37m @Output() show = new EventEmitter;[0;0m | |
| [1;37m [0;0m | |
| [1;31m- val: string;[0;0m | |
| [1;37m inputType = 'password';[0;0m | |
| [1;37m showLabel = 'ACCOUNT.LABELS.PASSWORDSHOW';[0;0m | |
| [1;37m [0;0m | |
| [1;35m@@ -45,17 +42,6 @@ export class PasswordComponent implements ControlValueAccessor {[0;0m | |
| [1;37m [0;0m | |
| [1;37m constructor(private platform: Platform) {}[0;0m | |
| [1;37m [0;0m | |
| [1;31m- get value() {[0;0m | |
| [1;31m- return this.val;[0;0m | |
| [1;31m- }[0;0m | |
| [1;31m-[0;0m | |
| [1;31m- set value(val) {[0;0m | |
| [1;31m- if (val) {[0;0m | |
| [1;31m- this.val = val;[0;0m | |
| [1;31m- this.propagateChange(val);[0;0m | |
| [1;31m- }[0;0m | |
| [1;31m- }[0;0m | |
| [1;31m-[0;0m | |
| [1;37m showTap() {[0;0m | |
| [1;37m if (this.inputType === 'password') {[0;0m | |
| [1;37m this.inputType = 'text';[0;0m | |
| [1;35m@@ -72,22 +58,4 @@ export class PasswordComponent implements ControlValueAccessor {[0;0m | |
| [1;37m this.passwordField.setFocus();[0;0m | |
| [1;37m this.show.emit(this.inputType === 'password');[0;0m | |
| [1;37m }[0;0m | |
| [1;31m-[0;0m | |
| [1;31m- propagateChange: any = () => {[0;0m | |
| [1;31m- };[0;0m | |
| [1;31m-[0;0m | |
| [1;31m- propagateTouch: any = () => {[0;0m | |
| [1;31m- };[0;0m | |
| [1;31m-[0;0m | |
| [1;31m- writeValue(value) {[0;0m | |
| [1;31m- this.value = value;[0;0m | |
| [1;31m- }[0;0m | |
| [1;31m-[0;0m | |
| [1;31m- registerOnChange(fn) {[0;0m | |
| [1;31m- this.propagateChange = fn;[0;0m | |
| [1;31m- }[0;0m | |
| [1;31m-[0;0m | |
| [1;31m- registerOnTouched(fn) {[0;0m | |
| [1;31m- this.propagateTouch = fn;[0;0m | |
| [1;31m- }[0;0m | |
| [1;37m }[0;0m | |
| [1;32mdiff --git a/src/app/password/password.html b/src/app/password/password.html[0;0m | |
| [1;37mindex a8f18cc..066efcb 100644[0;0m | |
| [1;31m--- a/src/app/password/password.html[0;0m | |
| [1;34m+++ b/src/app/password/password.html[0;0m | |
| [1;35m@@ -1,5 +1,5 @@[0;0m | |
| [1;37m <ion-item [ngClass]="wrapperCss">[0;0m | |
| [1;37m <ion-label [ngClass]="labelCss" floating [translate]="label"></ion-label>[0;0m | |
| [1;31m- <ion-input [ngClass]="inputCss" #passwordField [(ngModel)]="value" [type]="inputType" autocomplete clearOnEdit="false"></ion-input>[0;0m | |
| [1;34m+ <ion-input [ngClass]="inputCss" #passwordField [formControl]="control" [type]="inputType" autocomplete clearOnEdit="false"></ion-input>[0;0m | |
| [1;37m <a [ngClass]="showButtonCss" item-right (tap)="showTap()" [translate]="showLabel"></a>[0;0m | |
| [1;37m </ion-item>[0;0m | |
| [1;32mdiff --git a/src/pages/account/change-password/change-password.html b/src/pages/account/change-password/change-password.html[0;0m | |
| [1;37mindex b51c78f..29c3efb 100644[0;0m | |
| [1;31m--- a/src/pages/account/change-password/change-password.html[0;0m | |
| [1;34m+++ b/src/pages/account/change-password/change-password.html[0;0m | |
| [1;35m@@ -5,9 +5,9 @@[0;0m | |
| [1;37m <ion-content>[0;0m | |
| [1;37m <form [formGroup]="change" (ngSubmit)="doChange()">[0;0m | |
| [1;37m <div [ngClass]="wrapperCss">[0;0m | |
| [1;31m- <tcp-password formControlName="currentPass" [labelCss]="inputLabelCss" [wrapperCss]="currentPassCss"[0;0m | |
| [1;34m+ <tcp-password [control]="change.controls.currentPass" [labelCss]="inputLabelCss" [wrapperCss]="currentPassCss"[0;0m | |
| [1;37m label="CHANGEPASS.CURRENTPASS"></tcp-password>[0;0m | |
| [1;31m- <tcp-password formControlName="newPass" [labelCss]="inputLabelCss" label="CHANGEPASS.NEWPASS"></tcp-password>[0;0m | |
| [1;34m+ <tcp-password [control]="change.controls.newPass" [labelCss]="inputLabelCss" label="CHANGEPASS.NEWPASS"></tcp-password>[0;0m | |
| [1;37m [0;0m | |
| [1;37m <ion-grid [ngClass]="validationWrapperCss">[0;0m | |
| [1;37m <ion-row text-left>[0;0m | |
| [1;35m@@ -44,7 +44,7 @@[0;0m | |
| [1;37m </ion-row>[0;0m | |
| [1;37m </ion-grid>[0;0m | |
| [1;37m [0;0m | |
| [1;31m- <tcp-password formControlName="confirmPass" [labelCss]="inputLabelCss"[0;0m | |
| [1;34m+ <tcp-password [control]="change.controls.confirmPass" [labelCss]="inputLabelCss"[0;0m | |
| [1;37m label="CHANGEPASS.CONFIRMPASS"></tcp-password>[0;0m | |
| [1;37m </div>[0;0m | |
| [1;37m [0;0m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment