ionic3

Ionic 3 Component vs Page

雨燕双飞 提交于 2019-12-02 15:45:38
Can you tell me what is the difference between Component and Page generator in the Ionic 3 app? It seems I can use page life cycle hooks like ionViewWillLeave inside the component too.So when should I use angular life cycle hooks then? If it is same then Why it has 2 generators? Hope you'll provide a feedback for this. Component generator: ionic generate component SubscribeTopicComponent Page generator: ionic generate page LoginPage Based on the conversation from the comments: It may be the same from the Angular point of view, but Pages and Components have a different meaning in Ionic. In

How to customize date.now format?

家住魔仙堡 提交于 2019-12-02 15:40:59
问题 .ts currentDate = Date.now(); .html {{ currentDate | date }} How can I display the time instead of Oct 25, 2019 I want it this way: Signed this {{25th}} day of {{October}} {{2019}}? Anyone there already implemented custom time format? 回答1: Full stackblitz with suffix and language support for month = working demo here You can use this pipe: import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ name: "customDatePipe", pure: true }) export class CustomDatePipe implements PipeTransform {

ionic 3 angular 4 animation not working

北战南征 提交于 2019-12-02 14:54:28
问题 I have a component where I am trying to animate an accordion list.. I have made all the changes such as including import { BrowserModule } from "@angular/platform-browser"; and import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; as well importing both module in imports the following piece of code used to work in ionic 2 angular 2 but now, it does not throw any error or what so ever , it just does not animate and the item is not hidden at all (meaning height does

Icon not displayed inside input line in Ionic 3

不想你离开。 提交于 2019-12-02 13:02:07
I have the following code in my Ionic 3 project. <ion-item> <ion-icon name="person" item-start></ion-icon> <ion-label floating>Email</ion-label> <ion-input type="email" name="email" [(ngModel)]="registerCredentials.email" required></ion-input> </ion-item> This gives me the following result. The icon in outside of the input line. Who to get it inside by keeping my Label floating. You can fix that by placing the icon inside of the label, like this: <ion-item> <ion-label floating> <ion-icon name="person" item-start></ion-icon> // <--- Here! Email </ion-label> <ion-input type="email" name="email"

Google Login + FCM together in an Ionic 2 project

ぐ巨炮叔叔 提交于 2019-12-02 12:59:13
问题 I am using Ionic2 framework and my app requires Google Login and fcm to receive notifications. I first integrated the Google Social Login using google plus native plugin and it was working perfectly fine. Then, on adding fcm I received following errors: Found com.google.android.gms:play-services-location:11.+, but version 9.0.0 is needed for the google-services plugin. Found com.google.android.gms:play-services-auth:11.8.0, but version 9.0.0 is needed for the google-services plugin. Found com

ionic 3 - What is the best practice to share variables across the application

ε祈祈猫儿з 提交于 2019-12-02 12:54:02
问题 For ionic 3 - what is the best practice to share variables across the application? For example, if I have a generic variable or generic array and I want it to be available across all source files in the application, what is the best way to do it? Should I use a provider and create getter functions or maybe there is some better and simple way to do it, such like header files in c? 回答1: I would follow the Angular documentation for the Core-feature model. Which means creating a common module for

CORS Issues (IONIC 3)

拈花ヽ惹草 提交于 2019-12-02 12:35:30
问题 I’m trying to handle with CORS issues in livereload mode, but I wasn’t able to find a reasonable solution for that. My backend was developed in Java and it’s running on localhost. Command: ionic cordova emulate ios -l -c -s --address 127.0.0.1 ion.config.json: { "name": "Smartmarket", "app_id": "", "type": "ionic-angular", "integrations": { "cordova": {} }, "proxies": [{ "path": "/SmartmarketWeb/endpoint", "proxyUrl": "http://127.0.0.1:8080/SmartmarketWeb/endpoint" }] } Request example: let

Can't resolve all parameters for TranslateService: (?, ?, ?, ?, ?, [object Object]

半腔热情 提交于 2019-12-02 12:30:41
I could not test my ionic 3 app in browser anymore since yesterday because I get the following error related to TranslateService . This seems not related to my code since I also face the same issue when I switch to my previous versions, although it worked fine at that moment. I tried to re-install the node modules with but still no luck. Do you know what I should do to solve this problem? Thanks! ERROR Error: Uncaught (in promise): Error: Can't resolve all parameters for TranslateService: (?, ?, ?, ?, ?, [object Object], [object Object]). Error: Can't resolve all parameters for

Paths must be non-empty strings and can't contain “.”, “#”, “$”, “[”, or “]” [duplicate]

只谈情不闲聊 提交于 2019-12-02 12:29:54
问题 This question already has an answer here : Object returned from Firebase signIn (1 answer) Closed last year . I am trying to register with firebase and ionic, but I face the problem from the beginning of the day, ERROR Error: Reference.child failed: First argument was an invalid path = "undefined". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]", can anyone help me with that this is the provider: import * as firebase from 'firebase'; import { Injectable } from '

IONIC 3: Plugin BackgroundMode dont work: Object(…) is not a function

☆樱花仙子☆ 提交于 2019-12-02 11:49:01
I need to run the code “this.backgroundMode.enable()” in my project, but it shows me the following error: "Object(...) is not a function" It imports it in app.module.ts in the following way: import {BackgroundMode} from '@ ionic-native / background-mode / ngx'; ... providers: [ ... BackgroundMode ...] And in the page (in my case is in app.component.ts, after deviceready, like the official documentation says) i use like: import {BackgroundMode} from '@ ionic-native / background-mode / ngx'; constructor(private backgroundMode: BackgroundMode) { } ... this.backgroundMode.enable(); Please I need