Last active
June 4, 2019 12:38
-
-
Save ova2/2628eb83349e5be9624fd204ea56c9b6 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
| @Component({ | |
| selector: 'app-identify-device', | |
| template: ` | |
| ... | |
| <form (submit)="identifyDevice()" [formGroup]="formGroup"> | |
| <ion-item> | |
| <ion-label color="dark" [position]="'stacked'">Track Number</ion-label> | |
| <ion-input clearInput type="text" formControlName="trackNumber"></ion-input> | |
| </ion-item> | |
| </form> | |
| ... | |
| ` | |
| }) | |
| export class IdentifyDevicePage implements OnInit { | |
| public formGroup: FormGroup; | |
| constructor(private _fb: FormBuilder, private _facade: CoreFacade) { | |
| this.formGroup = this._fb.group({ | |
| trackNumber: ['', [Validators.required]] | |
| }); | |
| } | |
| public ngOnInit(): void { | |
| this.formGroup.controls['trackNumber'].patchValue(this._facade.getTrackNumber()); | |
| } | |
| public identifyDevice(): void { | |
| this._facade.identifyDevice(this.mh.fcValue('trackNumber')) | |
| .subscribe(success => success && this._router.navigateByUrl('device-identified')); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is
this.mh.fcValue('trackNumber')?