ionic4

Ionic4 capacitor android livereload?

三世轮回 提交于 2020-02-02 11:01:58
问题 Is there posibility to run ionic4 app with capacitor on android device with livereload? I was looking for answear for a few hours now without a luck. Please help. 回答1: You can do it by adding the server object to the capacitor.config.json file, just use the url of your live reload server "server": { "url": "http://192.168.1.33:8100" } 回答2: You can use the ionic cli for this: ionic capacitor run android --livereload For example. Source: https://ionicframework.com/docs/cli/commands/capacitor

Ionic4 capacitor android livereload?

孤街醉人 提交于 2020-02-02 11:01:32
问题 Is there posibility to run ionic4 app with capacitor on android device with livereload? I was looking for answear for a few hours now without a luck. Please help. 回答1: You can do it by adding the server object to the capacitor.config.json file, just use the url of your live reload server "server": { "url": "http://192.168.1.33:8100" } 回答2: You can use the ionic cli for this: ionic capacitor run android --livereload For example. Source: https://ionicframework.com/docs/cli/commands/capacitor

how we can get the current page from app.component in ionic 4?

梦想与她 提交于 2020-02-02 00:10:18
问题 i am trying to get current page instance in app.component in ionic 4. in ionic 3 i can do it like this this.nav.getActive().instance 回答1: You can access the url from the Router. import { OnInit } from '@angular/core'; import { Router } from '@angular/router'; export class YourPage implements OnInit { constructor(private router: Router) {} ngOnInit() { console.log('this.router.url', this.router.url); } } 回答2: I'm in a similar situation. In a multi-page application, I need the instance of the

Ionic 4 ion-content scroll to bottom

江枫思渺然 提交于 2020-02-01 05:35:14
问题 I am creating a chat page using Ionic 4 and I'm trying to make it automatically scroll to the bottom of the page. I did it like this and it's not working: import { IonContent } from "@ionic/angular"; export class ChatroomPage implements OnInit { messageForm: FormGroup; messages: any[]; messenger: any; @ViewChild(IonContent) content: IonContent; constructor( private navExtras: NavExtrasService, private api: RestApiService, private httpNative: HTTP ) { } ngOnInit() { this.content.scrollToBottom

nonetype' object has no attribute 'decode' error when i upload the image to database

和自甴很熟 提交于 2020-01-30 11:42:26
问题 i am new to ionic4/angular4.i need to upload the profile pic to database.i wrote code but i don't know whether it is correct or not and when i am uploading it i am getting the above mentioned error. backed i am using Django and sorry for the bad indentation.i just beginner to programming. .ts async sendPictureToSomewhere() { const fileuri = await this.getPicture(); const blobinfo = await this.b64toBlob(fileuri); await this.upload(blobinfo); alert("done"); } async getPicture() { const options:

Ion-Select Options Wont Refresh After Changing The Array Of Objects

大城市里の小女人 提交于 2020-01-25 06:38:17
问题 I Have 2 Ion-Selects The Second One Should Be Updated When The First One Changes I've Setup An (ngModelChange) On The First One And I Change The Array Of Elements Which Are Shown in Second One But It Wont Work Please Help <ion-item text-right> <ion-select interface="alert" [interfaceOptions]="receiveDatesOptions" [compareWith]="compareWithDates" [(ngModel)]="receiveDate" (ngModelChange)="changedReceiveDate()" [selectedText]="receiveDate.datePersian"> <ion-select-option *ngFor="let date of

Ionic 4 - Dismiss or close Modal on platform hardware back button android

吃可爱长大的小学妹 提交于 2020-01-25 04:03:25
问题 In ionic 4, on hardware back button press I want to close or dismiss any modal that will be present. I have used the below given code, here the condition "if(modal) { modal.dismiss(); }" always get satisfied even if previous modal are dismissed constructor(private platform: Platform, private modalCtrl: ModalController) { this.initializeapp(); } initializeapp() { this.platform.registerBackButtonAction(1, async () => { const modal = await this.modalCtrl.getTop(); if (modal) { modal.dismiss(); }

Ionic 4 - Dismiss or close Modal on platform hardware back button android

我只是一个虾纸丫 提交于 2020-01-25 04:03:13
问题 In ionic 4, on hardware back button press I want to close or dismiss any modal that will be present. I have used the below given code, here the condition "if(modal) { modal.dismiss(); }" always get satisfied even if previous modal are dismissed constructor(private platform: Platform, private modalCtrl: ModalController) { this.initializeapp(); } initializeapp() { this.platform.registerBackButtonAction(1, async () => { const modal = await this.modalCtrl.getTop(); if (modal) { modal.dismiss(); }

How to embed third party framework on ionic capacitor custom plugin?

♀尐吖头ヾ 提交于 2020-01-24 19:03:10
问题 I am developing an Ionic Capacitor plugin which imports 2 iOs .framework files and a .bundle that refers to one of this .framework files. The thing is that no matter how I link/embed and point/copy this files on the plugin project, xcode claims, on the app project, that it cant find the module in the swift file. I already tried to add the files to the project, used the "Embedded binaries" option, linked libraries, allow non-modular includes (on build options menu), add the files to the

ionic 4 prevent/disable device hardware backbutton

試著忘記壹切 提交于 2020-01-24 13:55:00
问题 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(() =>