ionic3

Multiple HTTP Requests with RxJS, with parameters

倖福魔咒の 提交于 2019-12-08 05:25:02
问题 I call this api https://jokerleb.com/wp-json/wp/v2/ads/ I grab the id of each ad and then I append it to this url https://jokerleb.com/wp-json/wp/v2/media?parent=24385 My code is loadAds() { let i = 0; this.HttpClient.get(ENV.site_url + ENV.ads_url) .subscribe(res => { this.ads = this.ads.concat(res); this.HttpClient.get(ENV.site_url + ENV.ads_thumb_url + this.ads[i].id + "&&ads/" + this.ads[i].id) .subscribe(res => { this.items = this.items.concat(res); console.log(ENV.site_url + ENV.ads

Runtime Error this.object.remove is not a function

余生长醉 提交于 2019-12-08 05:23:31
In my Ionic app, I can't delete specific key, it keeps telling me that remove is not a function. It seems there are some things changed after the last updates in angularfire2 . It gives me this error: Runtime Error this.employees.remove is not a function TypeError: this.employees.remove is not a function at EmployeesPage.webpackJsonp.76.EmployeesPage.deleteEmployee (http://localhost:8100/build/main.js:319:24) at Object.eval [as handleEvent] (ng:///AppModule/EmployeesPage.ngfactory.js:47:31) at handleEvent (http://localhost:8100/build/vendor.js:12380:138) at callWithDebugContext (http:/

Center and crop image with CSS

女生的网名这么多〃 提交于 2019-12-08 05:08:28
I need to Center and crop image with CSS. I have followed this article .But device UI output is somewhat different. Can you explain the behavior of this? This is the use case: We don’t want to actually crop - just display the middle of the image. Some of the docs people will upload will be docs so don’t want this to be stretched. My question is I don't know why it transforms ( 1 image) landscape mode even though I got the image using portrait mode? Any explanation? photo { .photo { position: relative; width: 100%; height: 200px; overflow: hidden; img { position: absolute; left: 50%; top: 50%;

Ionic VirtualScroll Cannot read property 'length' of null

点点圈 提交于 2019-12-08 04:50:48
问题 I´m trying to use virtual scroll in Ionic 3 but it is not working. I have this function on my provider: getActiveAds(){ return this.afDb.list<AngularFireList<any>>('/ads-active', ref => ref.orderByChild('adPlanPriority').startAt(1).endAt(3)) } On my list page, i have this: constructor(public navCtrl: NavController, public navParams: NavParams, public loadingCtrl: LoadingController, public adProvider: AdProvider) { this.loading = this.loadingCtrl.create(); this.loading.present(); this.ads =

Ionic file download not working

坚强是说给别人听的谎言 提交于 2019-12-08 04:50:20
问题 I am building an ionic app for wallpapers. In the app,there is an image stored in www/assets/img displayed.I have build 2 buttons below,for downloading and retrieving the displayed image to the mobile device memory. When i click download button,a dialog is shown,saying "Download Succeeded!Pug.jpg was successfully downloaded to: filepath".But when i check the phone memory no such file is there.Also when i click "Retrieve"Button it's showing dialog saying"File retrieval succeed!Pug.jpg was

Runtime Error this.object.remove is not a function

一世执手 提交于 2019-12-08 04:39:22
问题 In my Ionic app, I can't delete specific key, it keeps telling me that remove is not a function. It seems there are some things changed after the last updates in angularfire2 . It gives me this error: Runtime Error this.employees.remove is not a function TypeError: this.employees.remove is not a function at EmployeesPage.webpackJsonp.76.EmployeesPage.deleteEmployee (http://localhost:8100/build/main.js:319:24) at Object.eval [as handleEvent] (ng:///AppModule/EmployeesPage.ngfactory.js:47:31)

Ionic 3 infinite-scroll simulate in e2e test jasmine/protractor

徘徊边缘 提交于 2019-12-08 04:39:13
问题 If you go here: http://ionicframework.com/docs/api/components/infinite-scroll/InfiniteScroll/ Inspect the demo and click the last item on the list: Then in the console type: $0.scrollIntoView() Infinite Scroll is never triggered. Is there a way to programmatically trigger infinite-scroll in protractor context? 回答1: The implementation of the scroll in your example rely on the speed/velocity of the scroll which I guess falls far from the expected range when scrollIntoView is called. One

Ionic 3 - Dropdown Select

白昼怎懂夜的黑 提交于 2019-12-08 03:30:40
问题 I am trying to recreate the below in Ionic 3 (see link for GIF). I have no idea what I am doing. I have tried to use the ionic select options but it is not giving me the desired effect. Can someone please help me with this? Dropdown Select: More Info: Currently I am at this point: Current Progress As you can see, very far off. My code is: <ion-grid> <ion-row> <ion-col col-3> <ion-item> <ion-label stacked>Filter</ion-label> <ion-select interface="popover"> <ion-option value="10">10</ion-option

How to set http call timeout in angularjs 4?

孤街醉人 提交于 2019-12-08 03:20:22
问题 I have seen in angularjs 4 official page (https://angular.io/guide/http) to set http call timeout but I did not find any reference. Has anyone tried to set it up? Thank you 回答1: If you are using RxJS version 6 and above the current syntax is this: import { timeout } from 'rxjs/operators'; ... getUsers() { return this.http.post(API_URL, {headers: Myheaders}) .pipe( timeout(5000) //5 seconds ); } Reference: https://rxjs-dev.firebaseapp.com/api/operators/timeout 回答2: There is a timeout operator:

Get promise of the result of activating geolocation

◇◆丶佛笑我妖孽 提交于 2019-12-08 03:16:57
问题 with this code: if (ionic.Platform.isIOS()) { cordova.plugins.diagnostic.switchToSettings(); } else { cordova.plugins.diagnostic.switchToLocationSettings(); } I can open the native device configuration to mark the geolocation. but I do not know how to do it when the user turns on the geolocation, it simply executes that code but does not get an answer from that. I would like (if possible) to know if the user turned on the geolocation or not. how can I do it? I am using ionic1 , although I