ionic3

ionic 3 publish app as PWA (Progressive Web App)

↘锁芯ラ 提交于 2019-12-03 18:43:56
问题 I want to publish my app as PWA so what i did is insert this script to index.html <!--script> if ('serviceWorker' in navigator) { navigator.serviceWorker.register('service-worker.js') .then(() => console.log('service worker installed')) .catch(err => console.log('Error', err)); } </script--> then install npm run ionic:build --prod it looks like it deploy it but my questions are: what files I need to upload to host for publish the app as PWA? why when I change something in the app and run

How to update value inside ionic 2 side menu

寵の児 提交于 2019-12-03 17:20:20
问题 How to "transfer" date from page into side-menu in Ionic2, i.e - Having app.page.html like following: <ion-menu [content]="content"> <ion-content class="menu-left"> <!-- User profile --> <div text-center padding-top padding-bottom class="primary-bg menu-left"> <a menuClose> <h4 light>{{userName}}</h4> </a> </div> <ion-list class="list-full-border"> <button ion-item menuClose *ngFor="let page of pages" (click)="openPage(page)"> <ion-icon item-left name="{{ page.icon }}"></ion-icon> {{ page

API error: <_UIKBCompatInputView: 0x13fd1d7c0; frame = (0 0; 0 0); layer = <CALayer: 0x1c4426e40>> returned 0 width, assuming UIViewNoIntrinsicMetric

蹲街弑〆低调 提交于 2019-12-03 17:17:12
问题 I'm using Ionic 3 on iPhone 7 plus with iOS 11. When I run my App, and fill in some text/input fields (basic forms) the app freezes for a few seconds and becomes completely unresponsive (which isn't good, not to say the least). I noticed this error coming up in Xcode, maybe that's the problem. Has anyone else encountered similar errors? API error: <_UIKBCompatInputView: 0x13fd1d7c0; frame = (0 0; 0 0); layer = > returned 0 width, assuming UIViewNoIntrinsicMetric 回答1: Remove deprecated items

How to remove installed ionic cordova plugin from ionic 2 / 3 or ionic V2+ project

强颜欢笑 提交于 2019-12-03 17:13:52
问题 I installed Cordova and Ionic Native plugins into the ionic3 project. But I need to remove only that specific Cordova and Ionic Native plugins from the project completely. (With its dependencies like npm ). Is there any proper way to do that? Appreciate any kind of your help. Thank you! 回答1: I just refer their document here. Example: To install a plugin we are using following way. ionic cordova plugin add <plugin-name> ( ionic cordova plugin add cordova-plugin-dialogs ) npm install --save

How to show error messages in forms in Ionic 3

怎甘沉沦 提交于 2019-12-03 16:27:12
Here i have try to display error messages in forms in Ionic-3 . Here is my email.html file: <form [formGroup]="form" (submit)="signIn()"> <ion-grid> <ion-row> <ion-col> <ion-item> <ion-label color="primary" floating>Email</ion-label> <ion-input [formControl]="form.controls['email']"></ion-input> </ion-item> <p *ngIf="form.controls.email.errors && form.controls.email.dirty" class="danger" padding>Email is not valid.</p> </ion-col> </ion-row> </ion-grid> <ion-list padding> <ion-item> <button ion-button default item-end color="light" (click)="cancel()">CANCEL</button> <button ion-button default

Cordova config.xml environment variables

﹥>﹥吖頭↗ 提交于 2019-12-03 16:16:14
问题 The Scenario: I'm building an Ionic3 application, and my config.xml have some data that I want to be able to change according to my environment (for example, I want that my facebook app id have different values for development, staging and production). I achieved this creating a template config.xml (the file is config.tpl.xml ) and a before_prepare cordova hook to replace the variables in the template with the correct values and save the generated content in config.xml . The cordova hook uses

Ionic 3's PWA & Firebase Cloud Messaging registration

风格不统一 提交于 2019-12-03 15:50:24
I was following this article here (which is not complete unfortunately) in attempt to learn how to friend Ionic 3 based PWA and Firebase Cloud Messaging: Push Notifications with FCM What I did: as advised in the article added FCM libraries into service-worker.js: 'use strict'; importScripts('./build/sw-toolbox.js'); importScripts('https://www.gstatic.com/firebasejs/4.9.0/firebase-app.js'); importScripts('https://www.gstatic.com/firebasejs/4.9.0/firebase-messaging'); firebase.initializeApp({ // get this from Firebase console, Cloud messaging section 'messagingSenderId': '47286327412' }); const

Ionic 3 ion-list horizontal - want to show a list ion-list horizontal

北慕城南 提交于 2019-12-03 15:25:39
I want to use Ionic 3 ion-list (or whatever works in Ionic 3) to show a horizontal list instead of the typical vertical list. Looking for a solution without a lot of css or hard to maintain code. <ion-content> <ion-list > <ion-item *ngFor="let data of dataArray" (click)="dataDetail(data)"> <ion-thumbnail item-left> <img src="https://data.url.com/{{data.path}}{{data.photoName}}"/> </ion-thumbnail> <h2>{{data.name}}</h2> <p>{{data.details}}</p> </ion-item> </ion-list> </ion-content> Any help is really appreciated. Thanks Phil rahul patel You can do it in this way. This works for me. HTML <ion

Identifier refers to a private member of the component

痞子三分冷 提交于 2019-12-03 15:20:30
问题 .html <offline-picks *ngFor="let pick of pickData" [data]="pick"></offline-picks> .ts export class OfflineArticlesPage { private pickData: picksModel[] = []; constructor(private localCacheService: LocalCacheServiceProvider) { } } When I used the private member as shown above it shows below error.I'm using Angular Language Service extension on VS code editor. [Angular] Identifier 'pickData' refers to a private member of the component Hope using private members inside the component is good

For-each in ionic2 with angularjs2

核能气质少年 提交于 2019-12-03 14:41:44
I make one application with IONIC-2 Beta version. I want to use for-each loop. is it possible to use for each in angular-V2? Thanks. First in the Component , you have to declare the array you want to show: import { Component } from "@angular/core"; @Component({ templateUrl:"home.html" }) export class HomePage { displayData : []; constructor() { this.displayData = [ { "text": "item 1", "value": 1 }, { "text": "item 2", "value": 2 }, { "text": "item 3", "value": 3 }, { "text": "item 4", "value": 4 }, { "text": "item 5", "value": 5 }, ]; } } If you want to change the values in the code, you can