浏览代码

still receiving type error definition

Eric Foster 6 年前
父节点
当前提交
6677cf2927

+ 2
- 3
ZipCoinRedIonicClient/ionic.config.json 查看文件

@@ -1,6 +1,5 @@
1 1
 {
2 2
   "name": "ZipCoinRed",
3 3
   "integrations": {},
4
-  "type": "ionic-angular",
5
-  "app_id": ""
6
-}
4
+  "type": "ionic-angular"
5
+}

+ 14
- 11
ZipCoinRedIonicClient/src/pages/wallet/wallet.html 查看文件

@@ -11,35 +11,38 @@
11 11
 
12 12
   <ion-item>
13 13
     <ion-label>Name</ion-label>
14
-    <ion-select [(ngModel)]="trans.fromId">
15
-      <ion-option *ngFor="let wallet of wallets" value={{wallet.publicKey}}>{{wallet.publicKey}}</ion-option>
14
+    <ion-select [(ngModel)]="transaction.senderPublicKey">
15
+      <!-- <ion-option *ngFor="let wallet of wallets" value={{wallet.publicKey}}>{{wallet.publicKey}}</ion-option> -->
16
+      <ion-option>34</ion-option>
17
+      <ion-option>3564</ion-option>
16 18
     </ion-select>
17 19
   </ion-item>
18 20
 
19
-  <ion-item>
20
-    <ion-label>{{wallet.amount}}</ion-label>
21
-    <ion-input></ion-input>
22
-  </ion-item>
23
-      
24
-  <ion-item>
21
+  <!-- <ion-item>
25 22
     <ion-label>{{wallet.publicKey}}</ion-label>
26 23
     <ion-input></ion-input>
27 24
   </ion-item>
28 25
 
26
+  <ion-item>
27
+    <ion-label>{{wallet.amount}}</ion-label>
28
+    <ion-input></ion-input>
29
+  </ion-item> -->
30
+      
29 31
   <div class = "bar bar-subheader bar-assertive">
30 32
     <h2 class = "title">Payment</h2>
31 33
   </div>
32 34
 
33 35
   <ion-item>
34 36
     <ion-label>To</ion-label>
35
-    <ion-select [(ngModel)]="trans.toId">
37
+    <ion-input [(ngModel)]="transaction.recipientPublicKey"></ion-input>
38
+    <!-- <ion-select>
36 39
         <ion-option *ngFor="let wallet of wallets" value={{wallet.publicKey}}>{{wallet.publicKey}}</ion-option>
37
-    </ion-select>
40
+    </ion-select> -->
38 41
   </ion-item>
39 42
       
40 43
   <ion-item>
41 44
     <ion-label>Amount</ion-label>
42
-    <ion-input type="number" placeholder ="enter an amount" [(ngModel)]="trans.amount"></ion-input>
45
+    <ion-input type="number" placeholder ="enter an amount" [(ngModel)]="transaction.amount"></ion-input>
43 46
   </ion-item>
44 47
   
45 48
   <button ion-button (click)="createTransaction()" (click)="ionViewDidLoad()">Pay</button>

+ 8
- 9
ZipCoinRedIonicClient/src/pages/wallet/wallet.ts 查看文件

@@ -11,17 +11,17 @@ import { FormGroup, FormBuilder, Validators } from '@angular/forms';
11 11
 })
12 12
 export class WalletPage {
13 13
 
14
-  transactionForm : FormGroup;
15
-  transaction : Transaction;
14
+
15
+  // transactionForm : FormGroup;
16
+  
17
+  // senderPublicKey: any;
18
+  // recipientPublicKey: any;
19
+  // amount: any;
20
+  transaction: any;
16 21
   wallets: Array<any>;
17 22
 
18 23
   constructor(public navCtrl: NavController, public navParams: NavParams,
19
-    public transactionService: TransactionService, private formBuilder : FormBuilder) {
20
-        this.transactionForm = this.formBuilder.group({
21
-          senderPublicKey: ['', Validators.required],
22
-          recipientPublicKey: ['', Validators.required],
23
-          amount: ['', Validators.required]
24
-        })
24
+    public transactionService: TransactionService){
25 25
   }
26 26
 
27 27
   ionViewDidLoad() {
@@ -36,7 +36,6 @@ export class WalletPage {
36 36
   }
37 37
 
38 38
   createTransaction(){
39
-    this.transaction = this.transactionForm.value;
40 39
     this.transactionService.createTransaction(this.transaction).subscribe(data => this.transaction = data as Transaction,
41 40
       err => {
42 41
         console.log(err);