ionic3

Ionic-3 Can't find Pipe

折月煮酒 提交于 2019-12-17 19:33:01
问题 I have just upgraded to Ionic 3.0.1 so I can use LazyLoading , and since that I can't use my custom Pipes : import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'StripHTML' }) export class StripHTML implements PipeTransform { transform(value, args) { let striped = value.replace(/(<([^>]+)>)/g, ""); if (args != null) { if (args.split != null) { striped = striped.split(args.split); if (args.index != null) { striped = striped[args.index]; } } } return striped; } } and in app.module

How can I use content.scrollTo() for ion-scroll in ionic2?

冷暖自知 提交于 2019-12-17 15:56:15
问题 I try to scroll to a fixed position, for example scrollTo(500, 20). Let's say that you are on a device, which has got a width of 300 pixel. The scroll target is now out of the screen scope, you have to scroll to the right. I solved this by doing the following: <ion-content> <ion-scroll scrollX="true" style="width:100%; height:100%; white-space: nowrap; "> <div style="width:1000px; "> [box1] [box2] [box3] [...] </div> </ion-scroll> </ion-content> Up to here everything is fine. The problem

Handling hardware back button in Ionic3 Vs Ionic4

懵懂的女人 提交于 2019-12-17 15:44:47
问题 Please find the below code for the Android hardware back button action in ionic3 . As Ionic4 uses angular routing for navigation how the pop event will take place for the back button? If we want to pop to the last page we can use the following code this.navCtrl.goBack('/products'); . But how we can use it for the android hardware back button action in ionic4 ? Ionic3 hardware back button action this.platform.registerBackButtonAction(() => { let activePortal = this.ionicApp._loadingPortal

TypeError: Object(…) is not a function

只愿长相守 提交于 2019-12-17 10:51:38
问题 working on ionic3, angularfire2 v5 TypeError: Object(...) is not a function at SwitchMapSubscriber.project (http://localhost:8100/build/vendor.js:73935:76) at SwitchMapSubscriber._next (http://localhost:8100/build/vendor.js:61778:27) at SwitchMapSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18) at RefCountSubscriber.Subscriber._next (http://localhost:8100/build/vendor.js:20786:26) at RefCountSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18)

Cannot read property of 'xxx' of undefined

穿精又带淫゛_ 提交于 2019-12-17 06:53:10
问题 I'm using Ionic 2, in which a component has two components and the data were shared using emitters. But when I execute the program, it comes to this error. Runtime Error Uncaught (in promise): TypeError: Cannot read property 'BillNo' of undefined TypeError: Cannot read property 'BillNo' of undefined at Object.eval [as updateDirectives] Here's my code: bill-settlement.html ... <page-bill-list (BillSelected)="onBillSelected($event)"></page-bill-list> ... <page-bill-details [billItem]="billItem"

Angular 2 + Ionic 2: Detect if an object was modified

∥☆過路亽.° 提交于 2019-12-17 05:11:52
问题 Q) If I've got an object with loads of properties, all bound to fields in a form, how do I catch when the object has changed? I don't want to put (blur) events on every field as the page is quite heavy already and this could lead to way too many listeners on the page. E.g Object: var person = { name: string, email: string, phone: string }; Form: <input [(ngModel)]="person.name" type="text" /> <input [(ngModel)]="person.email" type="text" /> <input [(ngModel)]="person.phone" type="text" /> 回答1

ionic images are not show on load until touch image for fullmodal - ionic3

久未见 提交于 2019-12-16 18:05:15
问题 <ion-content> <ion-slides class="image-slider" loop="false" slidesPerView="1"> <ion-slide *ngFor="let item of imageList"> <ion-thumbnail> <ion-img [src]="item" class="thumb-img" (click)="presentModal(item)"></ion-img> </ion-thumbnail> </ion-slide> </ion-slides> </ion-content> I got a very strange problem. How to fix it? after touch image for fullmodal image to show 回答1: ion-img is used to cache images when virtualScroll is being used. It is not an independent component. Since there is no

Ionic 3 value binding Geolocation

青春壹個敷衍的年華 提交于 2019-12-14 03:56:25
问题 ERROR TypeError: Cannot set property 'items' of null This is the result of: </ion-card> <button ion-button round outline (click)="logEvent($startTrackingButton)">Start tracking me</button> <ion-card> <ion-item> <h2>Locations:</h2> <ion-list no-lines> <h3 ion-item *ngFor="let item of items" (click)="itemSelected(item)"> {{ item }} </h3> </ion-list> </ion-item> </ion-card> </ion-content> (In Component.html), now for its .ts file: logEvent1(TrackNowButton) { /*Initializing geolocation*/ //

How to wait for response inside for loop?

谁说我不能喝 提交于 2019-12-14 03:35:49
问题 Description : I called an HTTP request inside for loop.I want to get the response from service file then increase loop.How can i wait to get response from service file then execute loop. for(let i=0;i<final_arr.length;i++) { this.user.list_upload(JSON.stringify(ins_arr)).subscribe(data=>{ if(data.hasOwnProperty('STATUS')) { if(data.STATUS.toLowerCase()=='success') { this.update(); } else if(data.STATUS.toLowerCase() == 'error') { this.user.showToast(data.MESSAGE); } } },err=>{ this.user

subscribe function doesn't work correctly

你离开我真会死。 提交于 2019-12-14 03:34:55
问题 in this piece of code the subscribe function executes after the last line in loadFromDB function: loadFromDB(){ const loading = this.loadingCtrl.create({ content: 'pleas wait' }); loading.present(); this.getInterviewFromDB() .subscribe((data) => { this.events = data; console.log( 'before'); }); this.getMeetingsFromDB().subscribe((data)=>{ this.events.concat(data); }); loading.dismiss(); console.log( 'after'); } the loading is present and dismiss before loading any data from database and this