ionic3

npm run ionic:build --prod giving strange error

左心房为你撑大大i 提交于 2020-01-30 05:59:45
问题 When I am trying to run npm run ionic:build --prod , it is giving me below errors: Error: Cannot determine the module for class OverlayPortal in F:/D/IONIC/quicktask/quicktask-web-froala/node_modules/ionic-angular/umd/components/app/overlay-portal.d.ts! Add OverlayPortal to the NgModule to fix it. Cannot determine the module for class IonicApp in F:/D/IONIC/quicktask/quicktask-web-froala/node_modules/ionic-angular/umd/components/app/app-root.d.ts! Add IonicApp to the NgModule to fix it.

Angular2,Typescript: How to put the radio button checked when in an array which displays one element per page?

纵然是瞬间 提交于 2020-01-28 02:55:28
问题 Let me explain it in detail.Sorry for the question framing. I've an array of Objects which is stored in the REST API. That array contains questions and choices. Each question has 4 choices which are radio buttons. I'm trying to display one question at a time on the same page along with the choices of the question. I've 2 buttons "previous" and "forward" which load the question on the same page. When I click the next button the next question in the array along with the choices are displayed

Show only first match from *ngIf expression

醉酒当歌 提交于 2020-01-26 04:42:27
问题 How can I show only one (first) match from the *ngIf. I have an object loop with *ngFor following with *ngIf expression containing items with same Id's and different dates. I want to filter and show only the one with most recent date, not duplicating them, since I filter by objectId. 回答1: In html file: <div *ngFor="let item of list"> <div *ngIf="item.id == matchWithCondion ?func():false"> Add your code here </div> </div> In typescript file initialize a variable as: let isFirstMatch = false;

How do I change the style of a single button inside a *ngFor in Ionic 3?

余生颓废 提交于 2020-01-25 07:55:06
问题 I am trying to change the style of the specific button I click in the *ngFor in the ion-col. Currently when I click on a button, the styles for all buttons changes at the same time. Here are my codes: <ion-col *ngFor="let item of displayRestaurant[0].seatTimeSlotAndDiscount | slice:indexStart:indexEnd; let i=index" no-padding> <button ion-button style="border-radius:100px;height:70px;width:70px;text-align:center;" (click)="clickedDiscount(item)" [ngClass]="clickedDiscountBoolean ?

Ionic native push registration format changed?

和自甴很熟 提交于 2020-01-25 07:00:05
问题 I am not sure why but it seems that the interface for push registration changed? My app follows the logic from https://ionicframework.com/docs/v3/native/push/ with pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration)); where registration used to be of below type export interface PushDevice{ registrationId: string; registrationType: string; } but now I am getting {"registrationId":"{length=32,bytes=0x459ca46ab66f4fe790220809215176d6..

Npm install not working for ionic 3, npm ERR! code Z_BUF_ERROR

一曲冷凌霜 提交于 2020-01-25 00:19:28
问题 I have issues for days. Now i try to create an ionic v3 app and every time it stops at line below. √ Preparing directory .\firstProject - done! √ Downloading and extracting blank starter - done! ? Integrate your new app with Cordova to target native iOS and Android? Yes ionic integrations enable cordova --quiet [INFO] Downloading integration cordova [INFO] Copying integrations files to project [OK] Integration cordova added! Installing dependencies may take several minutes. * IONIC DEVAPP *

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(() =>

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(() =>

How to style a Child html element in typescript / angular

本秂侑毒 提交于 2020-01-24 10:55:08
问题 i am using ionic 3 to build a hybrid mobile app, one of the requirements is that the user have the ability to change the toolbar color dynamically. after the page is rendered that's how the html looks like: <div id="divICanControl"> //this div i can control <div> //but this one is generated by the framework and this is the div that change the background color of the toolbar </div> </div> i tried to do the following: document.getElementById('divICanControl').childNodes[0].style.backgroundColor

Ionic 3 Native : File : {code: 5, message: “ENCODING_ERR”}

你。 提交于 2020-01-24 04:15:30
问题 I'm using the checkFile function from File API plugin in Ionic 3 to check if a file exists locally. The Promise rejects with the following error : FileError {code: 5, message: "ENCODING_ERR"} From what I see on the Mozilla Docs of the File API, the problem is that "The URL is malformed." However, I don't see how is the URL malformed. Here is the relevant code showing how I'm calling the function plus the actual values of involved variables (The value of baseDirectory is set to file:///data