ionic4

How to detect if ion-content has a scrollbar?

旧巷老猫 提交于 2019-12-10 18:39:29
问题 I want to hide or show elements when there is or there isn't a scrollbar on ion-content. More specifically, I want to show a button (to load more items in a list) when there's no scrollbar and hide it where there is a scrollbar (so the loading of more items is done by ion-infinite-scroll). My Ionic app will also be deployed to the desktop so users with large screens won't initially see a scrollbar and thus ion-infinite-scroll won't be triggered. Here's a demo that showcases the issue: home

Ionic Native HTTP does not work for Anroid 9 (Pie) and up?

蓝咒 提交于 2019-12-10 17:59:56
问题 I've created an app that connects successfully to our server using Ionic Native HTTP, testing it with Samsung Galaxy J7 Prime OS version Marshmallow and several others that were not yet under Android Pie. For some reason, when I tested it with a device under Android Pie, it won't work anymore and I'm receiving CORS policy issues. Has anybody encountered a similar issue? Is there a workaround for this? Unfortunately, modifications within the server config is not an option. I've also read some

Ionic 4 SQLite - TypeError: Object(…) is not a function

时光怂恿深爱的人放手 提交于 2019-12-10 17:19:39
问题 I'm using ionic 4 beta version. When I added the cordova-sqlite-storage plugin and tried to open the database, I got the following console error. TypeError: Object(...) is not a function[Learn More] index.js:125 ./node_modules/@ionic-native/sqlite/index.js/SQLiteObject< index.js:125 ./node_modules/@ionic-native/sqlite/index.js index.js:25 __webpack_require__ bootstrap:81 ./src/app/services/x.service.ts http://localhost:8100/main.js:5168:78 __webpack_require__ bootstrap:81 ./src/app/services/y

How to disable side menu in ionic 4?

别来无恙 提交于 2019-12-10 14:54:33
问题 I am using, this.menuCtrl.swipeEnable(false); for ionic 3 app. This works fine for disabling the side menu. But, it doesn't work for ionic 4! Below is my ionic 4 code sample: login.page.ts constructor(public loginService: LoginService, private router: Router, public menuCtrl: MenuController) { this.menuCtrl.swipeEnable(false); } app.component.html <ion-app> <ion-split-pane> <ion-menu type="push"> <ion-header> <ion-toolbar color="success"> <ion-title>Menu</ion-title> </ion-toolbar> </ion

ionic 4 - Uncaught TypeError when add plugin

拟墨画扇 提交于 2019-12-10 14:53:44
问题 I have created an ionic project(version: 4.0.6). I am getting below error after adding the plugin cordova-plugin-x-socialsharing from https://beta.ionicframework.com/docs/native/social-sharing. I am stuck here. Could anybody help me on this please. index.js:413 Uncaught TypeError: Object(...) is not a function at index.js:413 at Object../node_modules/@ionic-native/social-sharing/index.js (index.js:590) at __webpack_require__ (bootstrap:81) at Object../src/app/app.module.ts (app.global.ts:10)

Ionic 4 how do I receive componentProps?

南楼画角 提交于 2019-12-10 14:19:55
问题 In Ionic 4, I am trying to use the modalController to open a modal. I am able to open the modal and send componentProps , but I'm not sure how to receive those properties. Here's how I open the modal component: async showUpsert() { this.modal = await this.modalController.create({ component:UpsertComponent, componentProps: {test: "123"} }); return await this.modal.present(); } My question is; in the actual modal, how do I get test: "123" into a variable? 回答1: You can take those values with

Ionic 4 missing buttons on select dropdown element in InAppBrowser

爷,独闯天下 提交于 2019-12-10 12:04:43
问题 Opening a page with the cordova-plugin-inappbrowser and opening a dropdown/select list, I get the list, but without any confirm or cancel buttons displayed. I do get these outside of the inAppBrowser, in my normal app. This answer does not solve my question, because the element is inside the inAppBrowser, I think: https://stackoverflow.com/a/41203014/10005883 Now I can't close the select / dropdown element, unless I "click" something on the page containing this element. Is there any way to

Ionic 4 native http POST with multiple headers

廉价感情. 提交于 2019-12-10 11:46:03
问题 Here is how I am doing an http post from my Ionic app: import { HTTP } from '@ionic-native/http/ngx'; someAction(assetId: number, userId: number) { var asset: Asset = new Asset(); asset.assetId = assetId.toString(); asset.userId = userId.toString(); const options = { headers: "Content-Type: application/json; charset=utf-8" }; return this.http.post(this.url + "someAction", asset, options).then(data => { return "Done"; }).catch(err => { console.log(err); }); } According to the documentation

Router navigate on Ionic with animation blinking on ios using angular animations

徘徊边缘 提交于 2019-12-09 13:44:05
问题 I am setting page transitions between two pages on Ionic (v4) with @angular/animations and it all works great on chrome but not on safari. On a simple app only with two pages (eagerly loaded) I still have the problem, independent of the property that I try to animate. The blinking only goes away if I create an empty animation, but it is not the goal. Also, I am using eager loading. animations.ts export const fadeIn = trigger('fadeIn', [ state('entering', style({ //styles to be transitioned

How to refresh page in ionic 4

匆匆过客 提交于 2019-12-09 13:30:09
问题 I want to page refresh after successfully deleting the data. When i am deleting or updating then i have to do page refresh then my data refresh . How to use navController in ionic 4 please help me... book-list.page.html <ion-header> <ion-toolbar> <ion-buttons slot="start"> <ion-menu-button></ion-menu-button> </ion-buttons> <ion-title> Book List </ion-title> <ion-buttons slot="end"> <ion-button routerLink="/user-detail"> <ion-icon name="add-circle"></ion-icon> </ion-button> </ion-buttons> <