浏览代码

Deployment fix and add focus to name field in modal

Matt Raible 7 年前
父节点
当前提交
acb515d1b4
共有 2 个文件被更改,包括 14 次插入7 次删除
  1. 8
    1
      client/src/pages/beer/beer-modal.ts
  2. 6
    6
      deploy.sh

+ 8
- 1
client/src/pages/beer/beer-modal.ts 查看文件

@@ -1,5 +1,5 @@
1 1
 import { BeerService } from '../../providers/beer-service';
2
-import { Component } from '@angular/core';
2
+import { Component, ViewChild } from '@angular/core';
3 3
 import { GiphyService } from '../../providers/giphy-service';
4 4
 import { NavParams, ViewController, ToastController, NavController } from 'ionic-angular';
5 5
 import { NgForm } from '@angular/forms';
@@ -9,6 +9,7 @@ import { BeerPage } from './beer';
9 9
   templateUrl: './beer-modal.html'
10 10
 })
11 11
 export class BeerModalPage {
12
+  @ViewChild('name') name;
12 13
   beer: any = {};
13 14
   error: any;
14 15
 
@@ -42,4 +43,10 @@ export class BeerModalPage {
42 43
       this.dismiss();
43 44
     }, error => this.error = error)
44 45
   }
46
+
47
+  ionViewDidLoad() {
48
+    setTimeout(() => {
49
+      this.name.setFocus();
50
+    },150);
51
+  }
45 52
 }

+ 6
- 6
deploy.sh 查看文件

@@ -50,18 +50,18 @@ cf set-env ionic-server FORCE_HTTPS true
50 50
 cf start ionic-server
51 51
 
52 52
 # Get the URL for the server
53
-serverUri=https://`app_domain pwa-server`
53
+serverUri=https://`app_domain ionic-server`
54 54
 
55 55
 # Deploy the client
56 56
 cd $r/client
57 57
 npm run clean
58 58
 # replace the server URL in the client
59
-sed -i -e "s|http://localhost:8080|$serverUri|g" $r/client/src/app/app.module.ts
59
+sed -i -e "s|http://localhost:8080|$serverUri|g" src/app/app.module.ts
60 60
 npm install && ionic build ios
61 61
 
62
+# deploy client to phone
63
+ionic run ios
64
+
62 65
 # cleanup changed files
63 66
 git checkout $r/client
64
-rm $r/client/src/app/app.module.ts-e
65
-
66
-# deploy client to phone
67
-ionic run ios
67
+rm $r/client/src/app/app.module.ts-e