瀏覽代碼

Upgraded to latest version of Ionic and Spring Boot

Matt Raible 6 年之前
父節點
當前提交
ae86e597db
共有 83 個文件被更改,包括 6232 次插入159 次删除
  1. 1
    1
      deploy.sh
  2. 1
    0
      ionic-beer/.gitignore
  3. 0
    26
      ionic-beer/README.md
  4. 11
    13
      ionic-beer/config.xml
  5. 4
    1
      ionic-beer/ionic.config.json
  6. 6090
    0
      ionic-beer/package-lock.json
  7. 55
    59
      ionic-beer/package.json
  8. 8
    0
      ionic-beer/resources/README.md
  9. 二進制
      ionic-beer/resources/android/icon/drawable-hdpi-icon.png
  10. 二進制
      ionic-beer/resources/android/icon/drawable-ldpi-icon.png
  11. 二進制
      ionic-beer/resources/android/icon/drawable-mdpi-icon.png
  12. 二進制
      ionic-beer/resources/android/icon/drawable-xhdpi-icon.png
  13. 二進制
      ionic-beer/resources/android/icon/drawable-xxhdpi-icon.png
  14. 二進制
      ionic-beer/resources/android/icon/drawable-xxxhdpi-icon.png
  15. 二進制
      ionic-beer/resources/android/splash/drawable-land-hdpi-screen.png
  16. 二進制
      ionic-beer/resources/android/splash/drawable-land-ldpi-screen.png
  17. 二進制
      ionic-beer/resources/android/splash/drawable-land-mdpi-screen.png
  18. 二進制
      ionic-beer/resources/android/splash/drawable-land-xhdpi-screen.png
  19. 二進制
      ionic-beer/resources/android/splash/drawable-land-xxhdpi-screen.png
  20. 二進制
      ionic-beer/resources/android/splash/drawable-land-xxxhdpi-screen.png
  21. 二進制
      ionic-beer/resources/android/splash/drawable-port-hdpi-screen.png
  22. 二進制
      ionic-beer/resources/android/splash/drawable-port-ldpi-screen.png
  23. 二進制
      ionic-beer/resources/android/splash/drawable-port-mdpi-screen.png
  24. 二進制
      ionic-beer/resources/android/splash/drawable-port-xhdpi-screen.png
  25. 二進制
      ionic-beer/resources/android/splash/drawable-port-xxhdpi-screen.png
  26. 二進制
      ionic-beer/resources/android/splash/drawable-port-xxxhdpi-screen.png
  27. 二進制
      ionic-beer/resources/ios/icon/icon-1024.png
  28. 二進制
      ionic-beer/resources/ios/icon/icon-40.png
  29. 二進制
      ionic-beer/resources/ios/icon/icon-40@2x.png
  30. 二進制
      ionic-beer/resources/ios/icon/icon-50.png
  31. 二進制
      ionic-beer/resources/ios/icon/icon-50@2x.png
  32. 二進制
      ionic-beer/resources/ios/icon/icon-60.png
  33. 二進制
      ionic-beer/resources/ios/icon/icon-60@2x.png
  34. 二進制
      ionic-beer/resources/ios/icon/icon-60@3x.png
  35. 二進制
      ionic-beer/resources/ios/icon/icon-72.png
  36. 二進制
      ionic-beer/resources/ios/icon/icon-72@2x.png
  37. 二進制
      ionic-beer/resources/ios/icon/icon-76.png
  38. 二進制
      ionic-beer/resources/ios/icon/icon-76@2x.png
  39. 二進制
      ionic-beer/resources/ios/icon/icon-small.png
  40. 二進制
      ionic-beer/resources/ios/icon/icon-small@2x.png
  41. 二進制
      ionic-beer/resources/ios/icon/icon-small@3x.png
  42. 二進制
      ionic-beer/resources/ios/icon/icon.png
  43. 二進制
      ionic-beer/resources/ios/icon/icon@2x.png
  44. 二進制
      ionic-beer/resources/ios/splash/Default-568h@2x~iphone.png
  45. 二進制
      ionic-beer/resources/ios/splash/Default-667h.png
  46. 二進制
      ionic-beer/resources/ios/splash/Default-736h.png
  47. 二進制
      ionic-beer/resources/ios/splash/Default-Landscape-736h.png
  48. 二進制
      ionic-beer/resources/ios/splash/Default-Landscape@2x~ipad.png
  49. 二進制
      ionic-beer/resources/ios/splash/Default-Landscape~ipad.png
  50. 二進制
      ionic-beer/resources/ios/splash/Default-Portrait@2x~ipad.png
  51. 二進制
      ionic-beer/resources/ios/splash/Default-Portrait~ipad.png
  52. 二進制
      ionic-beer/resources/ios/splash/Default@2x~iphone.png
  53. 二進制
      ionic-beer/resources/ios/splash/Default@2x~universal~anyany.png
  54. 二進制
      ionic-beer/resources/ios/splash/Default~iphone.png
  55. 二進制
      ionic-beer/resources/splash.png
  56. 3
    2
      ionic-beer/src/app/app.module.ts
  57. 1
    1
      ionic-beer/src/app/app.scss
  58. 二進制
      ionic-beer/src/assets/imgs/logo.png
  59. 0
    14
      ionic-beer/src/declarations.d.ts
  60. 13
    2
      ionic-beer/src/index.html
  61. 1
    1
      ionic-beer/src/pages/beer/beer-modal.ts
  62. 0
    3
      ionic-beer/src/pages/beer/beer.module.ts
  63. 1
    1
      ionic-beer/src/pages/contact/contact.html
  64. 2
    2
      ionic-beer/src/pages/tabs/tabs.html
  65. 0
    1
      ionic-beer/src/pages/tabs/tabs.ts
  66. 9
    14
      ionic-beer/src/providers/beer-service.ts
  67. 9
    9
      ionic-beer/src/providers/giphy-service.ts
  68. 3
    2
      ionic-beer/src/service-worker.js
  69. 13
    3
      ionic-beer/src/theme/variables.scss
  70. 4
    2
      ionic-beer/tsconfig.json
  71. 0
    1
      server/pom.xml
  72. 1
    1
      server/src/main/java/com/example/demo/beer/BeerController.java
  73. 2
    0
      server/src/main/java/com/example/demo/beer/BeerRepository.java
  74. 二進制
      static/android-beer-list.png
  75. 二進制
      static/beer-delete.png
  76. 二進制
      static/beer-modal.png
  77. 二進制
      static/good-beers-json.png
  78. 二進制
      static/good-beers-ui.png
  79. 二進制
      static/ionic-labs.png
  80. 二進制
      static/ionic-tabs.png
  81. 二進制
      static/iphone-beer-list.jpg
  82. 二進制
      static/lighthouse-51.png
  83. 二進制
      static/no-http-provider.png

+ 1
- 1
deploy.sh 查看文件

@@ -63,5 +63,5 @@ ionic cordova run ios
63 63
 # See http://stackoverflow.com/a/43363820
64 64
 
65 65
 # cleanup changed files
66
-git checkout $r/ionic-beer
66
+sed -i -e "s|$serverUri|http://localhost:8080|g" src/providers/beer-service.ts
67 67
 rm $r/ionic-beer/src/providers/beer-service.ts-e

+ 1
- 0
ionic-beer/.gitignore 查看文件

@@ -13,6 +13,7 @@ log.txt
13 13
 npm-debug.log*
14 14
 
15 15
 .idea/
16
+.sourcemaps/
16 17
 .sass-cache/
17 18
 .tmp/
18 19
 .versions/

+ 0
- 26
ionic-beer/README.md 查看文件

@@ -1,26 +0,0 @@
1
-This is a starter template for [Ionic](http://ionicframework.com/docs/) projects.
2
-
3
-## How to use this template
4
-
5
-*This template does not work on its own*. The shared files for each starter are found in the [ionic2-app-base repo](https://github.com/driftyco/ionic2-app-base).
6
-
7
-To use this template, either create a new ionic project using the ionic node.js utility, or copy the files from this repository into the [Starter App Base](https://github.com/driftyco/ionic2-app-base).
8
-
9
-### With the Ionic CLI:
10
-
11
-Take the name after `ionic2-starter-`, and that is the name of the template to be used when using the `ionic start` command below:
12
-
13
-```bash
14
-$ sudo npm install -g ionic cordova
15
-$ ionic start myTabs tabs
16
-```
17
-
18
-Then, to run it, cd into `myTabs` and run:
19
-
20
-```bash
21
-$ ionic cordova platform add ios
22
-$ ionic cordova run ios
23
-```
24
-
25
-Substitute ios for android if not on a Mac.
26
-

+ 11
- 13
ionic-beer/config.xml 查看文件

@@ -1,20 +1,17 @@
1 1
 <?xml version='1.0' encoding='utf-8'?>
2 2
 <widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3
-    <name>MyApp</name>
3
+    <name>ionic-beer</name>
4 4
     <description>An awesome Ionic/Cordova app.</description>
5 5
     <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
6 6
     <content src="index.html" />
7 7
     <access origin="*" />
8
-    <allow-navigation href="http://ionic.local/*" />
9 8
     <allow-intent href="http://*/*" />
10 9
     <allow-intent href="https://*/*" />
11 10
     <allow-intent href="tel:*" />
12 11
     <allow-intent href="sms:*" />
13 12
     <allow-intent href="mailto:*" />
14 13
     <allow-intent href="geo:*" />
15
-    <preference name="webviewbounce" value="false" />
16
-    <preference name="UIWebViewBounce" value="false" />
17
-    <preference name="DisallowOverscroll" value="true" />
14
+    <preference name="ScrollEnabled" value="false" />
18 15
     <preference name="android-minSdkVersion" value="16" />
19 16
     <preference name="BackupWebStorage" value="none" />
20 17
     <preference name="SplashMaintainAspectRatio" value="true" />
@@ -64,6 +61,7 @@
64 61
         <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
65 62
         <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
66 63
         <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
64
+        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
67 65
         <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
68 66
         <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
69 67
         <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
@@ -76,13 +74,13 @@
76 74
         <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
77 75
         <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
78 76
         <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
77
+        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
79 78
     </platform>
80
-    <engine name="android" spec="^6.2.3" />
81
-    <engine name="ios" spec="^4.4.0" />
82
-    <plugin name="cordova-plugin-console" spec="^1.0.5" />
83
-    <plugin name="cordova-plugin-device" spec="^1.1.4" />
84
-    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
85
-    <plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
86
-    <plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
87
-    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
79
+    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
80
+    <plugin name="cordova-plugin-device" spec="^2.0.1" />
81
+    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
82
+    <plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" />
83
+    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
84
+    <engine name="ios" spec="4.5.4" />
85
+    <engine name="android" spec="~7.0.0" />
88 86
 </widget>

+ 4
- 1
ionic-beer/ionic.config.json 查看文件

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

+ 6090
- 0
ionic-beer/package-lock.json
文件差異過大導致無法顯示
查看文件


+ 55
- 59
ionic-beer/package.json 查看文件

@@ -1,62 +1,58 @@
1 1
 {
2
-    "name": "ionic-beer",
3
-    "version": "0.0.1",
4
-    "author": "Ionic Framework",
5
-    "homepage": "http://ionicframework.com/",
6
-    "private": true,
7
-    "scripts": {
8
-        "clean": "ionic-app-scripts clean",
9
-        "build": "ionic-app-scripts build",
10
-        "lint": "ionic-app-scripts lint",
11
-        "ionic:build": "ionic-app-scripts build",
12
-        "ionic:serve": "ionic-app-scripts serve"
2
+  "name": "ionic-beer",
3
+  "version": "0.0.1",
4
+  "author": "Ionic Framework",
5
+  "homepage": "http://ionicframework.com/",
6
+  "private": true,
7
+  "scripts": {
8
+    "clean": "ionic-app-scripts clean",
9
+    "build": "ionic-app-scripts build",
10
+    "lint": "ionic-app-scripts lint",
11
+    "ionic:build": "ionic-app-scripts build",
12
+    "ionic:serve": "ionic-app-scripts serve"
13
+  },
14
+  "dependencies": {
15
+    "@angular/common": "5.0.3",
16
+    "@angular/compiler": "5.0.3",
17
+    "@angular/compiler-cli": "5.0.3",
18
+    "@angular/core": "5.0.3",
19
+    "@angular/forms": "5.0.3",
20
+    "@angular/http": "5.0.3",
21
+    "@angular/platform-browser": "5.0.3",
22
+    "@angular/platform-browser-dynamic": "5.0.3",
23
+    "@ionic-native/core": "4.4.0",
24
+    "@ionic-native/splash-screen": "4.4.0",
25
+    "@ionic-native/status-bar": "4.4.0",
26
+    "@ionic/storage": "2.1.3",
27
+    "cordova-android": "7.0.0",
28
+    "cordova-ios": "4.5.4",
29
+    "cordova-plugin-device": "^2.0.1",
30
+    "cordova-plugin-ionic-keyboard": "^2.0.5",
31
+    "cordova-plugin-ionic-webview": "^1.1.16",
32
+    "cordova-plugin-splashscreen": "^5.0.2",
33
+    "cordova-plugin-whitelist": "^1.3.3",
34
+    "ionic-angular": "3.9.2",
35
+    "ionicons": "3.0.0",
36
+    "rxjs": "5.5.2",
37
+    "sw-toolbox": "3.6.0",
38
+    "zone.js": "0.8.18"
39
+  },
40
+  "devDependencies": {
41
+    "@ionic/app-scripts": "3.1.8",
42
+    "typescript": "2.4.2"
43
+  },
44
+  "description": "An Ionic project",
45
+  "cordova": {
46
+    "plugins": {
47
+      "cordova-plugin-whitelist": {},
48
+      "cordova-plugin-device": {},
49
+      "cordova-plugin-splashscreen": {},
50
+      "cordova-plugin-ionic-webview": {},
51
+      "cordova-plugin-ionic-keyboard": {}
13 52
     },
14
-    "dependencies": {
15
-        "@angular/common": "4.1.0",
16
-        "@angular/compiler": "4.1.0",
17
-        "@angular/compiler-cli": "4.1.0",
18
-        "@angular/core": "4.1.0",
19
-        "@angular/forms": "4.1.0",
20
-        "@angular/http": "4.1.0",
21
-        "@angular/platform-browser": "4.1.0",
22
-        "@angular/platform-browser-dynamic": "4.1.0",
23
-        "@ionic-native/core": "3.7.0",
24
-        "@ionic-native/splash-screen": "3.7.0",
25
-        "@ionic-native/status-bar": "3.7.0",
26
-        "@ionic/storage": "2.0.1",
27
-        "cordova-android": "^6.2.3",
28
-        "cordova-ios": "^4.4.0",
29
-        "cordova-plugin-console": "^1.0.5",
30
-        "cordova-plugin-device": "^1.1.4",
31
-        "cordova-plugin-splashscreen": "^4.0.3",
32
-        "cordova-plugin-statusbar": "^2.2.2",
33
-        "cordova-plugin-whitelist": "^1.3.1",
34
-        "ionic-angular": "3.2.1",
35
-        "ionic-plugin-keyboard": "^2.2.1",
36
-        "ionicons": "3.0.0",
37
-        "rxjs": "5.1.1",
38
-        "sw-toolbox": "3.6.0",
39
-        "zone.js": "0.8.10"
40
-    },
41
-    "devDependencies": {
42
-        "@ionic/app-scripts": "1.3.7",
43
-        "@ionic/cli-plugin-cordova": "1.4.0",
44
-        "@ionic/cli-plugin-ionic-angular": "1.3.1",
45
-        "typescript": "2.2.1"
46
-    },
47
-    "description": "An Ionic project",
48
-    "cordova": {
49
-        "plugins": {
50
-            "cordova-plugin-console": {},
51
-            "cordova-plugin-device": {},
52
-            "cordova-plugin-splashscreen": {},
53
-            "cordova-plugin-statusbar": {},
54
-            "cordova-plugin-whitelist": {},
55
-            "ionic-plugin-keyboard": {}
56
-        },
57
-        "platforms": [
58
-            "android",
59
-            "ios"
60
-        ]
61
-    }
53
+    "platforms": [
54
+      "ios",
55
+      "android"
56
+    ]
57
+  }
62 58
 }

+ 8
- 0
ionic-beer/resources/README.md 查看文件

@@ -0,0 +1,8 @@
1
+These are Cordova resources. You can replace icon.png and splash.png and run
2
+`ionic cordova resources` to generate custom icons and splash screens for your
3
+app. See `ionic cordova resources --help` for details.
4
+
5
+Cordova reference documentation:
6
+
7
+- Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html
8
+- Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/

二進制
ionic-beer/resources/android/icon/drawable-hdpi-icon.png 查看文件


二進制
ionic-beer/resources/android/icon/drawable-ldpi-icon.png 查看文件


二進制
ionic-beer/resources/android/icon/drawable-mdpi-icon.png 查看文件


二進制
ionic-beer/resources/android/icon/drawable-xhdpi-icon.png 查看文件


二進制
ionic-beer/resources/android/icon/drawable-xxhdpi-icon.png 查看文件


二進制
ionic-beer/resources/android/icon/drawable-xxxhdpi-icon.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-land-hdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-land-ldpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-land-mdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-land-xhdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-land-xxhdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-land-xxxhdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-port-hdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-port-ldpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-port-mdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-port-xhdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-port-xxhdpi-screen.png 查看文件


二進制
ionic-beer/resources/android/splash/drawable-port-xxxhdpi-screen.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-1024.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-40.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-40@2x.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-50.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-50@2x.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-60.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-60@2x.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-60@3x.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-72.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-72@2x.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-76.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-76@2x.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-small.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-small@2x.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon-small@3x.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon.png 查看文件


二進制
ionic-beer/resources/ios/icon/icon@2x.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default-568h@2x~iphone.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default-667h.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default-736h.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default-Landscape-736h.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default-Landscape@2x~ipad.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default-Landscape~ipad.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default-Portrait@2x~ipad.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default-Portrait~ipad.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default@2x~iphone.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default@2x~universal~anyany.png 查看文件


二進制
ionic-beer/resources/ios/splash/Default~iphone.png 查看文件


二進制
ionic-beer/resources/splash.png 查看文件


+ 3
- 2
ionic-beer/src/app/app.module.ts 查看文件

@@ -10,8 +10,9 @@ import { TabsPage } from '../pages/tabs/tabs';
10 10
 
11 11
 import { StatusBar } from '@ionic-native/status-bar';
12 12
 import { SplashScreen } from '@ionic-native/splash-screen';
13
+
13 14
 import { BeerPageModule } from '../pages/beer/beer.module';
14
-import { HttpModule } from '@angular/http';
15
+import { HttpClientModule } from '@angular/common/http';
15 16
 
16 17
 @NgModule({
17 18
   declarations: [
@@ -23,7 +24,7 @@ import { HttpModule } from '@angular/http';
23 24
   ],
24 25
   imports: [
25 26
     BrowserModule,
26
-    HttpModule,
27
+    HttpClientModule,
27 28
     IonicModule.forRoot(MyApp),
28 29
     BeerPageModule
29 30
   ],

+ 1
- 1
ionic-beer/src/app/app.scss 查看文件

@@ -1,4 +1,4 @@
1
-// http://ionicframework.com/docs/v2/theming/
1
+// http://ionicframework.com/docs/theming/
2 2
 
3 3
 
4 4
 // App Global Sass

二進制
ionic-beer/src/assets/imgs/logo.png 查看文件


+ 0
- 14
ionic-beer/src/declarations.d.ts 查看文件

@@ -1,14 +0,0 @@
1
-/*
2
-  Declaration files are how the Typescript compiler knows about the type information(or shape) of an object.
3
-  They're what make intellisense work and make Typescript know all about your code.
4
-
5
-  A wildcard module is declared below to allow third party libraries to be used in an app even if they don't
6
-  provide their own type declarations.
7
-
8
-  To learn more about using third party libraries in an Ionic app, check out the docs here:
9
-  http://ionicframework.com/docs/v2/resources/third-party-libs/
10
-
11
-  For more info on type definition files, check out the Typescript docs here:
12
-  https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html
13
-*/
14
-declare module '*';

+ 13
- 2
ionic-beer/src/index.html 查看文件

@@ -11,7 +11,11 @@
11 11
   <link rel="manifest" href="manifest.json">
12 12
   <meta name="theme-color" content="#4e8ef7">
13 13
 
14
-  <!-- cordova.js required for cordova apps -->
14
+  <!-- add to homescreen for ios -->
15
+  <meta name="apple-mobile-web-app-capable" content="yes">
16
+  <meta name="apple-mobile-web-app-status-bar-style" content="black">
17
+
18
+  <!-- cordova.js required for cordova apps (remove if not needed) -->
15 19
   <script src="cordova.js"></script>
16 20
 
17 21
   <script>
@@ -26,6 +30,9 @@
26 30
 
27 31
 </head>
28 32
 <body>
33
+<noscript>
34
+  <h1>You must enable JavaScript to view this page.</h1>
35
+</noscript>
29 36
 
30 37
   <!-- Ionic's root component and where the app will load -->
31 38
   <ion-app></ion-app>
@@ -33,7 +40,11 @@
33 40
   <!-- The polyfills js is generated during the build process -->
34 41
   <script src="build/polyfills.js"></script>
35 42
 
36
-  <!-- The bundle js is generated during the build process -->
43
+  <!-- The vendor js is generated during the build process
44
+       It contains all of the dependencies in node_modules -->
45
+  <script src="build/vendor.js"></script>
46
+
47
+  <!-- The main bundle js is generated during the build process -->
37 48
   <script src="build/main.js"></script>
38 49
 
39 50
 </body>

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

@@ -19,7 +19,7 @@ export class BeerModalPage {
19 19
               public toastCtrl: ToastController,
20 20
               public navCtrl: NavController) {
21 21
     if (this.params.data.id) {
22
-      this.beerService.get(this.params.get('id')).subscribe(beer => {
22
+      this.beerService.get(this.params.get('id')).subscribe((beer: any) => {
23 23
         this.beer = beer;
24 24
         this.beer.href = beer._links.self.href;
25 25
         this.giphyService.get(beer.name).subscribe(url => beer.giphyUrl = url);

+ 0
- 3
ionic-beer/src/pages/beer/beer.module.ts 查看文件

@@ -13,9 +13,6 @@ import { BeerModalPage } from './beer-modal';
13 13
   imports: [
14 14
     IonicPageModule.forChild(BeerPage),
15 15
   ],
16
-  exports: [
17
-    BeerPage
18
-  ],
19 16
   providers: [
20 17
     BeerService,
21 18
     GiphyService

+ 1
- 1
ionic-beer/src/pages/contact/contact.html 查看文件

@@ -10,7 +10,7 @@
10 10
   <ion-list>
11 11
     <ion-list-header>Follow us on Twitter</ion-list-header>
12 12
     <ion-item>
13
-      <ion-icon name="ionic" item-left></ion-icon>
13
+      <ion-icon name="ionic" item-start></ion-icon>
14 14
       @ionicframework
15 15
     </ion-item>
16 16
   </ion-list>

+ 2
- 2
ionic-beer/src/pages/tabs/tabs.html 查看文件

@@ -1,6 +1,6 @@
1 1
 <ion-tabs>
2 2
   <ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>
3 3
   <ion-tab [root]="tab2Root" tabTitle="Beer" tabIcon="beer"></ion-tab>
4
-  <ion-tab [root]="tab3Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
5
-  <ion-tab [root]="tab4Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>
4
+  <ion-tab [root]="tab3Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>
5
+  <ion-tab [root]="tab4Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
6 6
 </ion-tabs>

+ 0
- 1
ionic-beer/src/pages/tabs/tabs.ts 查看文件

@@ -9,7 +9,6 @@ import { BeerPage } from '../beer/beer';
9 9
   templateUrl: 'tabs.html'
10 10
 })
11 11
 export class TabsPage {
12
-
13 12
   tab1Root = HomePage;
14 13
   tab2Root = BeerPage;
15 14
   tab3Root = AboutPage;

+ 9
- 14
ionic-beer/src/providers/beer-service.ts 查看文件

@@ -1,39 +1,34 @@
1 1
 import { Injectable } from '@angular/core';
2
-import { Http, Response } from '@angular/http';
3
-import 'rxjs/add/operator/map';
4
-import 'rxjs/add/operator/catch';
5 2
 import { Observable } from 'rxjs';
3
+import { HttpClient } from '@angular/common/http';
6 4
 
7 5
 @Injectable()
8 6
 export class BeerService {
9
-  public API = 'http://localhost:8080';
7
+  public API = 'http://192.168.1.48:8080';
10 8
   public BEER_API = this.API + '/beers';
11 9
 
12
-  constructor(public http: Http) {}
10
+  constructor(public http: HttpClient) {
11
+  }
13 12
 
14 13
   getGoodBeers(): Observable<any> {
15
-    return this.http.get(this.API + '/good-beers')
16
-      .map((response: Response) => response.json());
14
+    return this.http.get(this.API + '/good-beers');
17 15
   }
18 16
 
19 17
   get(id: string) {
20
-    return this.http.get(this.BEER_API + '/' + id)
21
-      .map((response: Response) => response.json());
18
+    return this.http.get(this.BEER_API + '/' + id);
22 19
   }
23 20
 
24 21
   save(beer: any): Observable<any> {
25
-    let result: Observable<Response>;
22
+    let result: Observable<Object>;
26 23
     if (beer['href']) {
27 24
       result = this.http.put(beer.href, beer);
28 25
     } else {
29 26
       result = this.http.post(this.BEER_API, beer)
30 27
     }
31
-    return result.map((response: Response) => response.json())
32
-      .catch(error => Observable.throw(error));
28
+    return result.catch(error => Observable.throw(error));
33 29
   }
34 30
 
35 31
   remove(id: string) {
36
-    return this.http.delete(this.BEER_API + '/' + id)
37
-      .map((response: Response) => response.json());
32
+    return this.http.delete(this.BEER_API + '/' + id);
38 33
   }
39 34
 }

+ 9
- 9
ionic-beer/src/providers/giphy-service.ts 查看文件

@@ -1,22 +1,22 @@
1 1
 import { Injectable } from '@angular/core';
2
-import { Http, Response } from '@angular/http';
3
-import { Observable } from 'rxjs';
2
+import { HttpClient } from '@angular/common/http';
3
+import 'rxjs/add/operator/map';
4 4
 
5 5
 @Injectable()
6 6
 // http://tutorials.pluralsight.com/front-end-javascript/getting-started-with-angular-2-by-building-a-giphy-search-application
7 7
 export class GiphyService {
8 8
 
9
-  giphyApi = 'https://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=';
9
+  // Public beta key: https://github.com/Giphy/GiphyAPI#public-beta-key
10
+  giphyApi = 'https://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&limit=1&q=';
10 11
 
11
-  constructor(public http: Http) {
12
+  constructor(public http: HttpClient) {
12 13
   }
13 14
 
14
-  get(searchTerm): Observable<any> {
15
+  get(searchTerm) {
15 16
     const apiLink = this.giphyApi + searchTerm;
16
-    return this.http.request(apiLink).map((res: Response) => {
17
-      const results = res.json().data;
18
-      if (results.length > 0) {
19
-        return results[0].images.original.url;
17
+    return this.http.get(apiLink).map((response: any) => {
18
+      if (response.data.length > 0) {
19
+        return response.data[0].images.original.url;
20 20
       } else {
21 21
         return 'https://media.giphy.com/media/YaOxRsmrv9IeA/giphy.gif'; // dancing cat for 404
22 22
       }

+ 3
- 2
ionic-beer/src/service-worker.js 查看文件

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Check out https://googlechrome.github.io/sw-toolbox/ for
2
+ * Check out https://googlechromelabs.github.io/sw-toolbox/ for
3 3
  * more info on how to use sw-toolbox to custom configure your service worker.
4 4
  */
5 5
 
@@ -15,6 +15,7 @@ self.toolbox.options.cache = {
15 15
 self.toolbox.precache(
16 16
   [
17 17
     './build/main.js',
18
+    './build/vendor.js',
18 19
     './build/main.css',
19 20
     './build/polyfills.js',
20 21
     'index.html',
@@ -23,7 +24,7 @@ self.toolbox.precache(
23 24
 );
24 25
 
25 26
 // dynamically cache any other local assets
26
-self.toolbox.router.any('/*', self.toolbox.cacheFirst);
27
+self.toolbox.router.any('/*', self.toolbox.fastest);
27 28
 
28 29
 // for any other requests go to the network, cache,
29 30
 // and then only use that cached resource if your user goes offline

+ 13
- 3
ionic-beer/src/theme/variables.scss 查看文件

@@ -1,7 +1,17 @@
1 1
 // Ionic Variables and Theming. For more info, please see:
2
-// http://ionicframework.com/docs/v2/theming/
2
+// http://ionicframework.com/docs/theming/
3
+
4
+// Font path is used to include ionicons,
5
+// roboto, and noto sans fonts
3 6
 $font-path: "../assets/fonts";
4 7
 
8
+
9
+// The app direction is used to include
10
+// rtl styles in your app. For more info, please see:
11
+// http://ionicframework.com/docs/theming/rtl-support/
12
+$app-direction: ltr;
13
+
14
+
5 15
 @import "ionic.globals";
6 16
 
7 17
 
@@ -10,7 +20,7 @@ $font-path: "../assets/fonts";
10 20
 // To customize the look and feel of this app, you can override
11 21
 // the Sass variables found in Ionic's source scss files.
12 22
 // To view all the possible Ionic variables, see:
13
-// http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/
23
+// http://ionicframework.com/docs/theming/overriding-ionic-variables/
14 24
 
15 25
 
16 26
 
@@ -66,7 +76,7 @@ $colors: (
66 76
 // Ionicons
67 77
 // --------------------------------------------------
68 78
 // The premium icon font for Ionic. For more info, please see:
69
-// http://ionicframework.com/docs/v2/ionicons/
79
+// http://ionicframework.com/docs/ionicons/
70 80
 
71 81
 @import "ionic.ionicons";
72 82
 

+ 4
- 2
ionic-beer/tsconfig.json 查看文件

@@ -17,10 +17,12 @@
17 17
     "src/**/*.ts"
18 18
   ],
19 19
   "exclude": [
20
-    "node_modules"
20
+    "node_modules",
21
+    "src/**/*.spec.ts",
22
+    "src/**/__tests__/*.ts"
21 23
   ],
22 24
   "compileOnSave": false,
23 25
   "atom": {
24 26
     "rewriteTsconfig": false
25 27
   }
26
-}
28
+}

+ 0
- 1
server/pom.xml 查看文件

@@ -56,7 +56,6 @@
56 56
     </dependencies>
57 57
 
58 58
     <build>
59
-        <defaultGoal>spring-boot:run</defaultGoal>
60 59
         <plugins>
61 60
             <plugin>
62 61
                 <groupId>org.springframework.boot</groupId>

+ 1
- 1
server/src/main/java/com/example/demo/beer/BeerController.java 查看文件

@@ -16,7 +16,7 @@ public class BeerController {
16 16
     }
17 17
 
18 18
     @GetMapping("/good-beers")
19
-    @CrossOrigin(origins = "http://localhost:4200")
19
+    @CrossOrigin(origins = {"http://localhost:8100","http://localhost:8080"})
20 20
     public Collection<Beer> goodBeers() {
21 21
 
22 22
         return repository.findAll().stream()

+ 2
- 0
server/src/main/java/com/example/demo/beer/BeerRepository.java 查看文件

@@ -2,7 +2,9 @@ package com.example.demo.beer;
2 2
 
3 3
 import org.springframework.data.jpa.repository.JpaRepository;
4 4
 import org.springframework.data.rest.core.annotation.RepositoryRestResource;
5
+import org.springframework.web.bind.annotation.CrossOrigin;
5 6
 
6 7
 @RepositoryRestResource
8
+@CrossOrigin(origins = {"http://localhost:8100","http://localhost:8080"})
7 9
 interface BeerRepository extends JpaRepository<Beer, Long> {
8 10
 }

二進制
static/android-beer-list.png 查看文件


二進制
static/beer-delete.png 查看文件


二進制
static/beer-modal.png 查看文件


二進制
static/good-beers-json.png 查看文件


二進制
static/good-beers-ui.png 查看文件


二進制
static/ionic-labs.png 查看文件


二進制
static/ionic-tabs.png 查看文件


二進制
static/iphone-beer-list.jpg 查看文件


二進制
static/lighthouse-51.png 查看文件


二進制
static/no-http-provider.png 查看文件