ionic有自身的生命週期,不可與angular混用;css
ionic有自身的路由機制,不可用angular路由;html
<ion-refresher [enabled] ='refresherB && showLoading$ | async' pullMin='60' pullMax='300' (ionPull)='doRefress()' (ionRefresh)="doRefresh($event)"></ion-refresher>
複製代碼
//在頁面構造前的鉤子上加上
let elements = document.querySelectorAll(".tabbar");
if (elements != null) {
Object.keys(elements).map((key) => {
elements[key].style.display = 'none';
});
}
//在頁面銷燬的鉤子上加上
let elements = document.querySelectorAll(".tabbar");
if (elements != null) {
Object.keys(elements).map((key) => {
elements[key].style.display = 'flex';
});
}
複製代碼
public eventBus:Subject<string> = new Subject<string>();
複製代碼
@Component({
changeDetection:ChangeDetectionStrategy.OnPush
});
複製代碼
//沒法正確設置,這是angualr4.3以前http模塊的寫法
const params = new HttpParams();
params.set('orderBy', '"$key"');
params.set('limitToFirst', "1");
//代替方案
const params = new HttpParams();
params = params.append('orderBy', "$key");
params = params.append('limitToFirst', "1");
複製代碼