ionic3

how to filter *ngFor result based on a selected dropdown value

我是研究僧i 提交于 2019-12-18 05:22:08
问题 Choosing a category: <ion-select name="categories"> <ion-option *ngFor="let category of categories;"> {{category}} </ion-option> </ion-select> Listing the items: <ion-item-sliding *ngFor="let item of items; let idx = index;"> <ion-item> <h2>{{item.title}}</h2> </ion-item> ... </ion-item-sliding> How can I use the value from (select) to choose which category gets listed? I tried adding a ngModule in and passing it as a condition into the sliding ngFor, but it wouldn't work. 回答1: You can use a

how to filter *ngFor result based on a selected dropdown value

ε祈祈猫儿з 提交于 2019-12-18 05:22:07
问题 Choosing a category: <ion-select name="categories"> <ion-option *ngFor="let category of categories;"> {{category}} </ion-option> </ion-select> Listing the items: <ion-item-sliding *ngFor="let item of items; let idx = index;"> <ion-item> <h2>{{item.title}}</h2> </ion-item> ... </ion-item-sliding> How can I use the value from (select) to choose which category gets listed? I tried adding a ngModule in and passing it as a condition into the sliding ngFor, but it wouldn't work. 回答1: You can use a

Ionic2 Ion-select without OK and Cancel

烈酒焚心 提交于 2019-12-18 04:53:09
问题 I have built an Ionic2 app and I am currently trying to improve the UX. To do that, I received some feedback that made me think of whether there is a way of having a <ion-select> <ion-option> </ion-option> </ion-select> which upon tapped on, would give me the output straight away and not wait for the user to press on the currently appearing 'OK'and 'CANCEL' buttons that the ionic action sheet(http://ionicframework.com/docs/v2/api/components/select/Select/) uses by default. Any suggestions

Ionic - Error: Uncaught (in promise): removeView was not found

扶醉桌前 提交于 2019-12-18 03:05:12
问题 My Ionic app was working fine and I haven't done anything to it but suddenly I am getting this error and I don't know why. "Error: Uncaught (in promise): removeView was not found 回答1: When you want to manually dismiss the Ionic loading you may need to follow the below example. Which is working fine I have tested in ionic labs. Ionic 3+ Note: If you call this.loading.dismiss() manually, I don't recommend to use dismissOnPageChange, you are probably dismissing the same loading twice. Why the

Blank app fails debug build - /Info.plist file not found

孤街醉人 提交于 2019-12-18 01:22:01
问题 In a larger context I resorted back to creating a blank project and running my build commands. Same error: ionic start myApp blank cd myApp ionic cordova run ios --debug --target="iPhone-8" --consolelogs ionic-app-scripts build --target cordova --platform ios [11:39:29] ionic-app-scripts 3.2.0 [11:39:29] build dev started ... [11:39:30] clean started ... [11:39:30] clean finished in 1 ms [11:39:30] copy started ... [11:39:30] deeplinks started ... [11:39:30] deeplinks finished in 15 ms [11:39

Blank app fails debug build - /Info.plist file not found

本秂侑毒 提交于 2019-12-18 01:20:43
问题 In a larger context I resorted back to creating a blank project and running my build commands. Same error: ionic start myApp blank cd myApp ionic cordova run ios --debug --target="iPhone-8" --consolelogs ionic-app-scripts build --target cordova --platform ios [11:39:29] ionic-app-scripts 3.2.0 [11:39:29] build dev started ... [11:39:30] clean started ... [11:39:30] clean finished in 1 ms [11:39:30] copy started ... [11:39:30] deeplinks started ... [11:39:30] deeplinks finished in 15 ms [11:39

Save id to Firestore document

假如想象 提交于 2019-12-17 20:28:10
问题 I'd like to save the id of my document as a property as well, not only as a reference on the collection. At the moment I save it like this: const newSet: AngularFirestoreDocument<SetModel> = this.AngularFirestore.doc('users/' + this.navParams.data.userId); // adding user to our ddbb newSet.collection('sets').add(this.set) .then(function (docRef) { // ok }) .catch(function (error) { // error }); Would be that possible? Or do I need to save it, get the id and update it again? PS this is my ddbb

Typescript and multiple classes

青春壹個敷衍的年華 提交于 2019-12-17 20:13:45
问题 I have a component class as EventSchedulePage .It extends HandleStorageService abstract class as shown below.You can see that there is a method named showInvalidTokenAlert() on this subclass.I have to call this method each and every component(This method gives a token based error message to the user).So can you tell me how to implement or redesign my classes to cater this situation? 'cause I don't like to put showInvalidTokenAlert() on each and every component.I would like to keep that method

Using a third-party cordova plugin in Ionic 2 with TypeScript

谁都会走 提交于 2019-12-17 19:59:30
问题 In my Ionic 2 app (TypeScript), where I use plugins, for example the Camera plugin from ionic-native which works fine. Now I want to use BackgroundMode plugin : https://github.com/katzer/cordova-plugin-background-mode . I read the README, I did the installation as described. Under Usage it says that the plugin can be used like this: cordova.plugins.backgroundMode.enable(); In my IDE (Atom), when I type that, it says it can't find cordova. I googled a lot about cordova plugins and Ionic 2 and

IONIC 2 native Network.onDisconnect() running code twice

依然范特西╮ 提交于 2019-12-17 19:37:09
问题 i am working with ionic 2 RC1 and using sublime as text editor. i need to check if the network connection is connected or not. so for this purpose i am using ionic native Network for this purpose. but i am facing problem with the Network.onDisconnect() Observable. I have edited initializeApp() method in which i check for network connection and show alert if connection got disconnected. the I have the following code written in app.component.ts showAlert(title, msg) { let alert = this.alertCtrl