ionic3

Searchbar with filter and from JSON data with Ionic 2

北慕城南 提交于 2019-11-29 10:43:41
I'm very new to Typescript and Ionic 2 and I'm trying to filter trough a json response with Ionic 2 search bar. This is my code: import {Component} from '@angular/core'; import {NavController} from 'ionic-angular'; import {Http} from '@angular/http'; import 'rxjs/add/operator/map'; @Component({ templateUrl: 'build/pages/home/home.html' }) export class HomePage { posts: any; private searchQuery: string = ''; private items: string[]; constructor(private http: Http) { this.initializeItems(); this.http.get('https://domain.co/open.jsonp').map(res => res.json()).subscribe(data => { this.posts = data

Ionic and Firebase - InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'

家住魔仙堡 提交于 2019-11-29 10:05:37
I am having issue getting a basic CRUD to-do list app using Ionic 3 and Firebase to work. The error message I am stuck on is: Uncaught (in promise): Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' The error message started when I added the <ion-item *ngFor="let item of shoppingListRef$ | async"> section to shopping-list.html: shopping-list.html <ion-header> <ion-navbar color="primary"> <ion-title>Shopping List</ion-title> <ion-buttons end> <button ion-button icon-only (click)="navigateToAddShoppingPage()"> <ion-icon name="add"></ion-icon> </button> </ion-buttons> </ion

Iterate two arrays in *ngFor— IONIC2/Angular2

对着背影说爱祢 提交于 2019-11-29 09:31:27
问题 I have stored values in two arrays to iterate in a single ion-list . Billerstatusstate and Billerstatusnamelst are the two arrays. I have tried the following to iterate <ion-list ion-item *ngFor="let stat of Billerstatusstate;let bil of Billerstatusnamelst " > {{bil}} <button round>{{stat}}</button> </ion-list> and <ion-list ion-item *ngFor="let stat of Billerstatusstate" *ngFor="let bil of Billerstatusnamelst " > {{bil}} <button round>{{stat}}</button> </ion-list> Its taking first iterated

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

独自空忆成欢 提交于 2019-11-29 08:28:02
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. You can use a pipe to achieve this <ion-item-sliding *ngFor="let item of items | categorySelected; let idx = index;"> <ion

How to write custom components in Ionic 2/3 without losing prepared css?

半腔热情 提交于 2019-11-29 07:31:09
When I write my own custom component like this: import { Component } from '@angular/core'; @Component({ selector: 'deletableItem', template: ` <ion-checkbox item-right></ion-checkbox> ` }) export class DeletableItem { constructor() {} } And use it in some html view: <ion-content padding> <ion-list> <ion-item *ngFor="let bill of bills" (click)="openEdit(bill)"> <ion-label text-left>{{bill.name}}</ion-label> <deletableItem></deletableItem> </ion-item> </ion-list> </ion-content> The looking of it is worse than just put it in parent's component view at once like this: <ion-content padding> <ion

Ionic: Showing an alert controller with a checkbox and text input

谁说我不能喝 提交于 2019-11-29 07:24:26
I am trying to show a checkbox along with a text input field. (Ionic 3.5.3) The checkbox is not showing up. I looked at another SO thread for a similar question. The code seems to be the same as what I am doing. The code: let alert = this.alert.create({ title: 'Name your trip', inputs: [ { name: 'name', placeholder: 'Your trip name', }, { name: 'gpsxy', type:'checkbox', checked:true, label:'Log GPS co-ords', value:"true" } ], buttons: [{ text: 'Cancel', role: 'cancel', handler: data => { } }, { text: 'Ok', handler: data => { }], }); alert.present(); And here is the screenshot: Just like you

Error run on IOS emulator after update to IOS 11 - Ionic 3

左心房为你撑大大i 提交于 2019-11-29 06:10:33
问题 After update to IOS 11, command ionic cordova run ios -lc --target="iPhone-6" I have error ** BUILD SUCCEEDED ** No available runtimes could be found for "iPhone 6". [ERROR] An error occurred while running cordova run ios --target iPhone-6 (exit code 1). Simulators list after command ios-sim showdevicetypes Apple-TV-1080p, tvOS 11.0 Apple-TV-4K-4K, tvOS 11.0 Apple-TV-4K-1080p, tvOS 11.0 Apple-Watch-38mm, watchOS 4.0 Apple-Watch-42mm, watchOS 4.0 Apple-Watch-Series-2-38mm, watchOS 4.0 Apple

ngOnInit vs ionViewDidLoad in ionic 2 or ionic 2+

耗尽温柔 提交于 2019-11-29 05:01:42
问题 Which one will I use for initializing data and why? ngOnInit() { this.type = 'category'; this.getData(); this.setData(); } ionViewDidLoad() { this.type = 'category'; this.getData(); this.setData(); } 回答1: ngOnInit is a life cycle hook called by Angular2 to indicate that Angular is done creating the component. ionViewDidLoad is related to the Ionic's NavController lifeCycle events. It runs when the page has loaded. This event only happens once per page being created. Basically both are good

Ionic Uncaught Error: Cannot find module “.” when importing a service provider

心不动则不痛 提交于 2019-11-29 04:36:52
I am trying to import a new service provider that I just created after pulling from the latest branch in my ionic app. When I try to import this line of code: import { AuthServiceProvider } from '../providers/auth-service' in app.module.ts I always got an error saying that: Uncaught Error: Cannot find module "." at webpackMissingModule (index.js:3) at e.code (index.js:3) at Object.<anonymous> (index.js:9) at __webpack_require__ (bootstrap 62d6a5897825ac327001:54) at Object.690 (slide.transition.ts:67) at __webpack_require__ (bootstrap 62d6a5897825ac327001:54) at Object.495 (main.js:1885) at _

Angular 2 Inheritance to enable disable Ionic Menu Swipe

爱⌒轻易说出口 提交于 2019-11-29 04:11:41
问题 My problem: My application contains a menu which is swipe enabled. On login screen if I swipe I can see the menu which is not right. I want to disable menu swipe for pages that doesn't contains menu icon, like login, inner details pages containing back button, etc. Solution found: I am able to do that by following the SO link - https://stackoverflow.com/a/38654644/2193918 I created a base class and injected a menu object in it. Override ionViewDidEnter() and ionViewDidLeave() In sub class, I