ionic3

Where to save settings like API url in Ionic2 app? [duplicate]

夙愿已清 提交于 2019-12-10 03:36:11
问题 This question already has answers here : Ionic2/Angular2 - Read a custom config file (2 answers) Closed 2 years ago . I have several settings which should be in a configuration file. For example: URL of APIs Where is the best place for it in Ionic 2? 回答1: From Angular 2/4 Docs: Non-class dependencies What if the dependency value isn't a class? Sometimes the thing we want to inject is a string, function, or object . Applications often define configuration objects with lots of small facts (like

Check if running as “ionic serve” to use a conditional in the program

寵の児 提交于 2019-12-10 03:17:11
问题 Is there a way to detect that ionic serve CLI is running (and then not on a real device) in the program and use it as a conditional. My issue : I have a Cordova plugin that sends back an answer to Cordova. When I was using Ripple, it offered to chose the value of the callback to be sent back to JavaScript (to emulate the plugin result). I notice that Ionic2 does not do that when I run in a browser. So to ease my dev and make it possible to test it on a browser (and not build to the real

Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.0) in ionic3?

一笑奈何 提交于 2019-12-10 02:54:10
问题 I have got above error after generating build in ionic3 I have tried a lot of solution but not working tell me, anyone, how to fix above error? below I have to include //Project-properties file. I have tried below solution but did not work for me : Android: Getting "Manifest merger failed" error after updating to a new version of gradle https://forum.ionicframework.com/t/solved-ionic-run-android-com-android-support-conflicting-v26-alpha1-and-v25-3-1/91826/19 //Project-properties file target

Unable to merge dex Ionic 3

会有一股神秘感。 提交于 2019-12-09 17:10:12
问题 Last time I build successfully but after adding the number of pages I am unable to build, I did search for that error a lot but nothing works for me.For example, added and removed the platform , ionic cordova clean , ionic cordova build etc… Following Error facing by running-- ionic cordova build android What went wrong: Execution failed for task ‘ :app:transformDexArchiveWithExternalLibsDexMergerForD ebug’. java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.de xing

Ionic 3 - Does each Page need its own Module?

对着背影说爱祢 提交于 2019-12-09 12:09:27
问题 I am new to Ionic and trying to understand how to organize a medium sized application. Should each Page have its own Module? Or is it better to group similar Pages into the same Module? Is it even possible to do that? It appears the IonicPageModule.forChild() method only accepts one Page: IonicPageModule.forChild(AdministerUsersPage) So is it okay for every single Page to have its own Module? Are there any drawbacks to having this many modules? It seems like we went from one extreme to the

Could not find com.google.android.gms:strict-version-matcher-plugin:1.1.0

末鹿安然 提交于 2019-12-09 11:13:49
问题 Could not resolve all files for configuration 'classpath'. Could not find com.google.android.gms:strict-version-matcher-plugin:1.1.0. Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar file:/C:/Users/e1706396/.m2/repository/com/google/android/gms/strict

Ionic 3 - All imports are unused warning (even though they are being used)

♀尐吖头ヾ 提交于 2019-12-09 10:02:06
问题 I am getting the following error when trying to run a prod build using the following ionic cordova build browser --prod Getting lot of warnings in the terminal like FormBuilder is declared but never used Even though in my code I am importing it and using it e.g. import { Validators, FormGroup, FormBuilder } from '@angular/forms'; public form: FormGroup; constructor( private formBuilder: FormBuilder ) { setForm(){ this.form = this.formBuilder.group({ password: ['', Validators.required],

Return data from firebase function to app

旧街凉风 提交于 2019-12-08 21:25:54
问题 In my ionic app I am connecting to a stripe payment gateway. I have a function in firebase which is being triggered on updating the customer. exports.updateStripeCustomer = functions.database.ref("/Customers/{userId}") .onUpdate((snapshot, context) => { const data = snapshot.after.val(); return stripe.customers.createSource(data.payment_sources.customer_id, { source: data.payment_sources.source }).then(customer => { console.log("Update Stripe Customer"); return customer; }, error => { return

How to set http call timeout in angularjs 4?

人走茶凉 提交于 2019-12-08 19:41:31
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 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 There is a timeout operator: getUsers() { return this.http.post(this.baseUrl + "users", {headers: Myheaders}) .timeout(3000, new Error(

remove shadow from ion-searchbar in ionic 3

ⅰ亾dé卋堺 提交于 2019-12-08 19:12:34
I need to remove the border from ion-search bar . I tried the following code in variable.scss but got no luck.I am pretty new in ionic so please tell me in details. .searchbar-input { -webkit-box-shadow: 0 2px 2px 0 rgba(255, 255, 255, 1), 0 3px 1px -2px rgba(255, 255, 255, 1), 0 1px 5px 0 rgba(255, 255, 255, 1); box-shadow: 0 2px 2px 0 rgba(255, 255, 255, 1), 0 3px 1px -2px rgba(255, 255, 255, 1), 0 1px 5px 0 rgba(255, 255, 255, 1); } Is hard to figure out a solution without the output of your code, you might try this: .searchbar-input { border: 0 !important; box-shadow: none !important; } 来源