ionic-framework

I can't handle android back button on Ionic 4

北城以北 提交于 2020-03-04 16:48:10
问题 I am new on ionic development.I have tried more and more way by following articles. Finally I have tried on this Handling hardware back button in Ionic3 Vs Ionic4 Please help me @Fabian N. But on device, I can't seem if the back button work regards code... that is the code is not work in my case. :( This is my ionic info. Ionic: Ionic CLI : 5.2.3 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.6.2 @angular-devkit/build-angular : 0.13.9 @angular-devkit/schematics : 7.3.9

Open sidemenu from a tab button

梦想与她 提交于 2020-03-03 20:37:32
问题 I want to open the sidemenu from a tab button. The console outputs 'open menu' so i know the service method is being called but it will simply not open the menu. Where am i going wrong? This is my tabs.html <ion-tabs class="tabs-super-top tabs-top tabs-icon-left tabs-striped"> <ion-tab title="More" icon="icon ion-navicon" ng-click="openSideMenu()" > </ion-tab> <ion-tab title="Events" icon="icon ion-calendar" ui-sref="tab.events"> <ion-nav-view name="tab-events" class="slide-left-right" ion

Open sidemenu from a tab button

。_饼干妹妹 提交于 2020-03-03 20:36:54
问题 I want to open the sidemenu from a tab button. The console outputs 'open menu' so i know the service method is being called but it will simply not open the menu. Where am i going wrong? This is my tabs.html <ion-tabs class="tabs-super-top tabs-top tabs-icon-left tabs-striped"> <ion-tab title="More" icon="icon ion-navicon" ng-click="openSideMenu()" > </ion-tab> <ion-tab title="Events" icon="icon ion-calendar" ui-sref="tab.events"> <ion-nav-view name="tab-events" class="slide-left-right" ion

How do I change Ionic 4's ion-range pin font and formatting?

孤者浪人 提交于 2020-02-28 08:05:02
问题 As an example, I tried this in my global.scss file: .range-pin { color: white; font-family: sans-serif; &after:{ content: " %"; } } But this has no effect. I'm sure this has something to do with shadow root but I'm not sure what the right thing to do is here. Adding ion-range .range-pin to be more specific doesn't help either. How do I achieve this change? 回答1: You are correct that the ion-range pin is part of the shadow dom, therefore we must use the SCSS variables that Ionic provides to

How can I implement AMP in angular/ionic website?

℡╲_俬逩灬. 提交于 2020-02-27 06:00:59
问题 Recently i've heard about the Accelerated Mobile Pages project, and read some info about it. I wonder how to implement it for existing website that is built upon Ionic and Angular? 回答1: Basically there is no nearly possible solution to do that. If you check the doc here. Keep all third-party JavaScript out of the critical path Third-party JS likes to use synchronous JS loading. They also like to document.write more sync scripts. For example, If you five ads, and each does three sync loads,

Don't allow horizontal scroll when scrolling vertically (and vice versa)

风格不统一 提交于 2020-02-26 09:02:08
问题 I have a list, with the overflow-x and overflow-y set to auto . In addition, I've set up momentum scroll, so the touch scrolling works nice in mobile, using webkit-overflow-scrolling: true . The issue, however, is that I cannot figure out how to disable the horizontal scroll when scrolling vertically. It leads to really bad user experience, as the swiping towards the top left or top right will cause the table to scroll diagonally. When the user is scrolling vertically, I absolutely do NOT

src/zone-flags.ts is missing from the TypeScript compilation after upgrading to Ionic 5

自作多情 提交于 2020-02-24 11:12:32
问题 I upgraded my Ionic 4 application by these two commands: # Upgrading to Ionic 5 npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save # Upgrading to Angular 9 ng update @angular/core @angular/cli And when I did ionic serve , I started getting this error: > ng run app:serve --host=localhost --port=8100 [ng] chunk {} 0.js, 0.js.map () 22.1 kB [rendered] [ng] chunk {common} common.js, common.js.map (common) 25.7 kB [rendered] [ng] [ng] ERROR in ./src/zone-flags.ts [ng] Module

ionic button activated / active

☆樱花仙子☆ 提交于 2020-02-24 10:01:09
问题 I am looking to set an ionic button's state to active, but this isn't documented at all in the API docs. As of right now, when you click the button, the "activated" class is added to the button, and then removed a few moments later. 回答1: This can be done via [ngClass]="{'activated' : YourVariableHere }" HTML: <button class="post-button" [ngClass]="{'activated' : buttonActive}"ion-button outline small icon-left"> Component code: buttonActive: boolean = true; 来源: https://stackoverflow.com

Getting count of contacts correct but getting null values for contacts in Ionic 4

戏子无情 提交于 2020-02-23 08:07:25
问题 I am using ionic contacts plugin it is giving me the correct number of contacts in the phone but all the details field are null, I am using, “cordova-plugin-contacts”: “3.0.1”, “@ionic-native/contacts”: “^5.0.0” import { Contacts } from '@ionic-native/contacts/ngx'; constructor( private contactsPlugin: Contacts ) { } document.addEventListener("deviceready", () => { this.contactsPlugin.find(["displayName", "phoneNumbers","photos"], {multiple: true, hasPhoneNumber: true}) .then((contacts) => {

How to fix missing 'module not found' build error in Ionic 3 application

白昼怎懂夜的黑 提交于 2020-02-23 07:12:23
问题 I can't build Ionic 3 app for production with ionic cordova build android --prod --release Error received [14:06:47] ionic-app-script task: "build" [14:06:47] Error: ./src/pages/dashboard/dashboard.ngfactory.js Module not found: Error: Can't resolve '../../../node_modules/ionic3-calendar-en/src/calendar/calendar.ngfactory' in 'C:\repo\iota-mobile\src\pages\dashboard' resolve '../../../node_modules/ionic3-calendar-en/src/calendar/calendar.ngfactory' in 'C:\repo\iota-mobile\src\pages\dashboard'