ionic4

ionic 4 prevent/disable device hardware backbutton

我怕爱的太早我们不能终老 提交于 2020-01-24 13:53:27
问题 I'm using angular routing(@angular/router) for ionic 4 project to disable the device back-button in ionic 4 prevent-default is not working below is my code in app.component.ts this.platform.backButton.subscribe(() => { if (this.router.url === '/Login') { this.util.presentAppExitAlert(); } else { // event.preventDefault(); console.log("invoing url ", this.router.url); } }); }); i am not able to disable the device back-button any help here 回答1: initializeApp() { this.platform.ready().then(() =>

Ionic v4 menu only works when router-outlet has the main attribute

送分小仙女□ 提交于 2020-01-24 13:11:40
问题 I'm building an app with ionic v4 the first time and I want to include a side menu. For testing reasons, I first put it inside of the app.component.html but I couldn't let it swipe out or in. So I saw in the documentation, that they added the main attribute on the ion-router-outlet but as far as I read: it is not documented anywhere. I don't know, why I'd have to add this, to make it actually work. Source: https://ionicframework.com/docs/api/menu <ion-router-outlet main></ion-router-outlet>

Ionic v4 menu only works when router-outlet has the main attribute

白昼怎懂夜的黑 提交于 2020-01-24 13:11:10
问题 I'm building an app with ionic v4 the first time and I want to include a side menu. For testing reasons, I first put it inside of the app.component.html but I couldn't let it swipe out or in. So I saw in the documentation, that they added the main attribute on the ion-router-outlet but as far as I read: it is not documented anywhere. I don't know, why I'd have to add this, to make it actually work. Source: https://ionicframework.com/docs/api/menu <ion-router-outlet main></ion-router-outlet>

Ionic 4 keyboard covers input field

感情迁移 提交于 2020-01-24 04:23:07
问题 I have an Ionic 4 app that has a form with inputs in it. When the user clicks on the input, it opens the keyboard, but it hides the content, without scrolling. Is there any way around this? This is my code: <form #f="ngForm" (ngSubmit)="sendMail()"> <ion-item> <ion-label position="floating">name </ion-label> <ion-input [(ngModel)]="senderName"> </ion-input> </ion-item> <ion-item> <ion-label position="floating">mail </ion-label> <ion-input [(ngModel)]="senderMail"> </ion-input> </ion-item>

Ionic 4 - Customize context menu

放肆的年华 提交于 2020-01-23 11:12:47
问题 I'm building an Ionic app that has heavy text editing, and I would like to customize the context menu that appears when making a text selection (shown below). How can I add buttons to this menu? Can it be customized even further? Is it possible to switch this menu out entirely for some custom HTML menu else that appears when the user makes a text selection? I've seen the plugin cordova-plugin-context-menu but it does not seem to be what I need (although it's hard to say because it doesn't

Ionic 4 - Customize context menu

对着背影说爱祢 提交于 2020-01-23 11:12:24
问题 I'm building an Ionic app that has heavy text editing, and I would like to customize the context menu that appears when making a text selection (shown below). How can I add buttons to this menu? Can it be customized even further? Is it possible to switch this menu out entirely for some custom HTML menu else that appears when the user makes a text selection? I've seen the plugin cordova-plugin-context-menu but it does not seem to be what I need (although it's hard to say because it doesn't

how to add a text field with google places dynamically using ionic 4

半腔热情 提交于 2020-01-22 02:56:41
问题 I'm tying to use google-place-api autoComplete in my project, but it gives me an error: TypeError: Cannot read property 'getInputElement' of undefined .html <section [formGroupName]="i" *ngFor="let tech of form.controls.stations.controls; let i = index"> <ion-item-group> <ion-item-divider color="light">Station #{{ i + 1 }}</ion-item-divider> <ion-item> <ion-label position="floating">Technology name:</ion-label> <ion-input #autoStation type="text" maxlength="50" formControlName="name"></ion

how to access THIS in cordova plugin with IONIC

微笑、不失礼 提交于 2020-01-22 02:48:05
问题 i am trying to implement the apple-sign-in method using a cordova plugin and set the credentials to firebase. what i actually have is: constructor ( public afAuth: AngularFireAuth, public afs: AngularFirestore, @Inject(FirebaseApp) firebase: any ){ this.firebase = firebase; } loginApple(): Promise<boolean> { return new Promise((resolve, reject) => { cordova.plugins.SignInWithApple.signin({ requestedScopes: [0, 1] }, function(succ){ var provider = new firebase.auth.OAuthProvider('apple.com')

How do you add Font Awesome to Ionic 4

送分小仙女□ 提交于 2020-01-21 07:01:05
问题 There are a lot of tutorials and articles of how to include Font Awesome in an Ionic 3 project but I struggled finding any on how to add Font Awesome into an Ionic 4 project. So this poses the question, how do you add and use Font Awesome in an Ionic 4 project? I have tried using the following tutorial without much success. I tried following the steps outlined in the following StackOverflow answer which did not work either. 回答1: To get Font Awesome working in an Ionic 4 project you can follow

How to set background color IONIC 4

与世无争的帅哥 提交于 2020-01-20 17:08:53
问题 I having problems trying to change the background color in just one IONIC 4 (--type=angular) page. I am trying to add a class for the ion-content. In my html file I Have: <ion-content class="fondologin"> ... </ion-content> In my sass I have: .fondologin{ background-color: #111D12!important; } The background color is never changed. If I add --ion-background-color:#111D12; in variables.scss the background is successfully changed for every page but I just one to change the color in one page. How