https://github.com/driftyco/ionic/issues/6776#issuecomment-267961514
https://github.com/driftyco/ionic-app-scripts/issues/596
This problem…. just update
>> ionic info
Ionic Framework
Ionic CLI
Ionic App Lib
Ionic App Scripts
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.1
So
1、npm update to best new
npm update -g
2、uninstall ionic
npm uninstall ionic
3、install ionic
npm install -g ionic
4、update package.js in project
npm install -g npm-check-updates
https://github.com/driftyco/ionic-cli/issues/935
just put www directory on root
https://gxiangco.gitbooks.io/m3-app-dev/content/part4/%E6%9B%B4%E6%8F%9Bicons%E5%8F%8Asplashscreen.html
1、 change resource icon.png and splash.png
2、ionic resources 3、check resource android and ios images is changed ?
4、apk
4.1、 ionic platform remove android then ionic platform add android
or
4.2、
ionic build android
copy res android and ios images to platform/android or ios inside
https://ionicframework.com/docs/v2/native/photo-viewer/
follow step just do.
Now focus
https://github.com/sarriaroman/photoviewer/issues/11
ps: declare var cordova: any;
ps2: cordova plugin add cordova-plugin-file
www/assets/img is ionic2 now version, maybe future change, but now this is correct
showImage(imageUrl) {
if (this.platform.is(‘cordova’) && this.platform.is(‘android’)) {
File.readAsDataURL(cordova.file.applicationDirectory + “www/assets/img/”, imageUrl)
.then((dataURL:string) => {
PhotoViewer.show(dataURL, “”, {share: false})
})
.catch(
(err)=>{alert(“err: “+err)
});
} else if (this.platform.is(‘cordova’) && this.platform.is(‘ios’)) {
PhotoViewer.show(cordova.file.applicationDirectory + “www/assets/img/"+imageUrl);
}
}
https://github.com/apache/cordova-plugin-file
import { App } from ‘ionic-angular’;
http://blog.turn.tw/?p=1539
View Model 2: 不具有行為,只是等別人塞資料進去的模板(template)。 MVC: 具有監視Model的行為,並以此去改變呈現(presentation)。 Controller Model 2: 接收請求與參數,轉交給Model處理,再把結果(最新的資料)塞進View。 MVC: 接收請求與參數,轉交給Model處理。沒其他事了。 Model Model 2: 接收Controller傳來的參數,回傳結果。 MVC: 接收Controller傳來的參數,將結果通知View。
https://www.zybuluo.com/cxm-2016/note/467206
==========
http://www.itread01.com/articles/1476290449.html
Operators一句話介紹(RxJava版)
Cold Observables
在第一個subscriber訂閱後才執行事件發送的Observables,默認普通Observables都是這個類型
Cold Observables對於每個訂閱的subscriber執行一次事件發送過程的重演,每次事件實體將重新生成,尤其對於每次隨機生成的數值將不保證保持一致性
參考:Observable vs ConnectableObservable
Hot Observables
從創建一刻開始立即發送事件,此後進行訂閱的subscribers僅能接收在訂閱後發送的事件
Hot Observables發送的事件實體對象在所有subscribers之間進行共享
Connectable Observables
在connect()調用時進行事件發送動作,不論是否有subscriber執行了訂閱。實際上是把該Observable轉換為Hot Observable,發送的事件實體對象在所有subscribers之間進行共享
Creating
create / just(T..) / from(Iterable/Array) 常用Observable構建方式
defer(Func0) 延遲生成Observable,每次subscribe時生成新的Observable
range(start, len) 發送從start開始的數字序列,長度為len,值區間為[start, start+len-1]
repeat(n) 非直接構造器,將上個構造好的Observable重復n次發送(前一次Observable發送onCompleted後再啟動下一次的重訂閱),不傳參時表示無限repeat
repeatWhen(Func1<Observable, Observable) 通過函數判斷是否進行下一次重訂閱,可參考retryWhen(Func1)解釋
interval(time) 周期性發送一個序號數字(從0開始的正整數序列順序)
timer(time) 在指定時間後發送數字0
Transforming
map(Func1) / cast(class) 將單個事件轉型為另一類型事件或據此構造新的次級Observable並匯入單一事件流
flatMap / flatMapIterable 依據單個事件構造新的次級Observable或Iterable並匯入單一事件流,flatMap不保證發送順序 (允許交叉發送)
concatMap / switchMap concatMap是有序化版本的flatMap,switchMap是強時效版本的flatMap(下個次級Observable開始發送事件時,前面的次級Observable將自動被終止發送)
buffer(count/time) 按數量、時間緩存前後多個事件為一個個小組,再按小組為單位逐次發送
window(count/time) 類似於buffer,但緩存的小組以子Observable形式作為事件發送 (需要二次subscribe分發)
groupBy(KeyFunc, ValueFunc) 通過函數獲得每個事件的Key值進行分組,並將事件轉換為Value類型,返回發送GroupedObservable類型事件的包裹Observable (需要二次subscribe分發)
scan(Func2(x1, x2)) 前一次實際發送的事件x1與本次該發送的源事件x2通過函數計算,其結果作為本次實際發送的的事件,第0個初始事件不經過函數直接發送
Filtering