ionic3

Error - This command can only be run inside of a CLI project

懵懂的女人 提交于 2019-12-06 00:53:05
问题 I am working on an ionic 3 project with the name portal. I need to create a service called user but i keep getting the above error. These are the steps i followed: cd portal npm install -g angular-cli@latest npm install ng g service user Then i get the error This command can only be run inside of a CLI project . I noticed that angular-cli is not getting added to my dependency list in package.json nor do i have the cli directory under @angular in the node modules directory. I tried the install

How to measure the performance of an Ionic 3 app?

我的梦境 提交于 2019-12-06 00:05:26
I have developed an app using Ionic 3 framework. I would like to measure the CPU and memory usage of my app. What is the best practice to do so? You must not use AndroidStudio and XCode to measure the memory usage of the Ionic app . Why? Here is the comment from Ionic team member Unfortunately we have not been able to reproduce this issue on our end. Would you mind checking your app on your device with safari dev tools instead of the memory tool in xcode? The reason I recommend this is because the xcode memory tools can be misleading in the fact that it's not actually measuring memory usage of

Tabs disappears ionic 3 after push

你。 提交于 2019-12-05 22:41:08
My Tabs disappears after using this.navCtrl.push(NamePage); I don't understand, I need use @ViewChild or another function? I have set tabsHideOnSubPages on false in app.module.ts Example : https://github.com/Nicolas-PL/TestMenu Files is : src/pages/tabs/tabs.ts and src/pages/test/test.ts import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { AboutPage } from '../about/about'; import { ContactPage } from '../contact/contact'; import { HomePage } from '../home/home'; import { TestPage } from '../test/test'; import { ModalController } from 'ionic

Ionic 3 deep-linking and lazy-loading at the same time

前提是你 提交于 2019-12-05 22:03:07
According to what I've read in the documentation and forums , you enable deep-linking via : forRoot(appRoot, config, deepLinkConfig) @ngModule({ .. IonicModule.forRoot(MyApp, {}, { links:[{ component: ContactPage, name: "contact", segment: "contact"}, { component: HelloPage, name: "hello", segment: "hello" } ] }) ... }) ... This leads to adding ContactPage and HelloPage to declarations and entryComponents arrays within @ngModule , which would not be lazy-loaded. So, this leads to the question, can you substitute strings, doing away with the imports and double array declaration, and have this?

IONIC 3 IOS can't read data from file

蹲街弑〆低调 提交于 2019-12-05 21:49:51
问题 I am using this file picker to upload files to my server: https://github.com/jcesarmobile/FilePicker-Phonegap-iOS-Plugin My server takes base64 files, so I need to convert the file I uploaded. I am doing that using the file plugin mentioned in the ionic docs. So my code looks like this: uploadIOS(){ var self=this let utis = ["public.data"] FilePicker.pickFile( function (uri) { let correctPath = uri.substr(0, uri.lastIndexOf('/') + 1); let currentName = uri.substring(uri.lastIndexOf('/') + 1);

How can I draw a line between two google map native markers? (Ionic 3, cordova)

不问归期 提交于 2019-12-05 20:48:15
How can I draw a line between two google maps native markers? In my project, I need one dynamic marker and one fixed marker. addMarker() { this.map.addMarker({ title: 'My Marker', icon: 'blue', animation: 'DROP', position: { lat: this.place.lat, lng: this.place.lng } }) .then(marker => { marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => { alert('Marker Clicked'); }); }); } 2nd marker: addMarker2() { this.map.addMarker({ title: 'My Marker', icon: 'blue', animation: 'DROP', position: { lat: -33, lng: 773231 } }) .then(marker => { marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {

How to focus ion-searchbar on button click

一世执手 提交于 2019-12-05 19:57:08
I am trying to focus ion-searchbar on button click but it is not working. This is my code Typescript @ViewChild('search') search:ElementRef; focusButton(){ console.log(this.search); //Searchbar {_config: Config, _elementRef: ElementRef, _renderer: RendererAdapter, _componentName: "searchbar", _mode: "md", …} console.log(this.search.nativeElement); // null this.search.nativeElement.focus(); // Cannot read property 'focus' of undefined this.search.nativeElement.setFocus(); // Cannot read property 'setFocus' of undefined } Html <ion-searchbar #search (ionCancel)="cancelSearch($event)"

How to know the request progress in each http request in Ionic and Angular

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 17:52:28
I don't have any code to show in this question. I am trying to google for it if there is someone who already created this feature with documentation. I also tried to find if someone already asked this question but didn't have that much luck. This is similarly to file download and upload with progress bar but that only works on file uploads/downloads but how can I dot it in just basic any post/put/delete request to the backend. So the end goal is I want to had a progress bar for each post and put or maybe delete request if possible that I will show the user the progress of their request with

How to change default push notification icon to small icon in Onesignal in ionic 3?

送分小仙女□ 提交于 2019-12-05 17:10:40
I have a problem to change small icon push notification Onesignal in ionic 3, I have tried this tutorial https://documentation.onesignal.com/docs/customize-notification-icons , https://ionicframework.com/docs/native/onesignal/ and https://github.com/OneSignal/OneSignal-Cordova-SDK/issues/341#issuecomment-382648188 , but fail all, small icon in my push notification still default of onesignal. This is my folder structure and my script : My folder structure : copy_android_notification_icons.js : #!/usr/bin/env node var fs = require('fs'); var path = require('path'); var rootDest = 'platforms

Ionic 2 Android Build Prod Warning while verifying jar signing

喜夏-厌秋 提交于 2019-12-05 15:32:40
I am getting an error while building my Ionic application, it occurs on a new app (which I started from the scratch couple of days ago). None of my old apps have this issue. The issue does not occur in any of older apps i.e., apps that are 4-5 months old. WARNING: META-INF/android.arch.lifecycle_runtime.version not protected by signature. Unauthorized modifications to this JAR entry will not be detected. Delete or move the entry outside of META-INF/. and it continues for 4-5 more files. My environment info: cli packages: (/usr/local/lib/node_modules) @ionic/cli-utils : 1.19.0 ionic (Ionic CLI)