ionic3

Not allowed to load local resource: ionic 3 android

亡梦爱人 提交于 2019-11-30 07:20:17
I am using ionic 3 android build apk and trying to laod image from file:///storage/emulated/0/data/io.ionic.vdeovalet/cache/image.jpeg takePicture(sourceType) { try { // Create options for the Camera Dialog var options = { quality: 100, destinationType: this.camera.DestinationType.FILE_URI, encodingType: this.camera.EncodingType.JPEG, sourceType: sourceType, }; this.camera.getPicture(options).then((imagePath) => { // Special handling for Android library if (this.platform.is('android') && sourceType === this.camera.PictureSourceType.PHOTOLIBRARY) { this.filePath.resolveNativePath(imagePath)

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

时光毁灭记忆、已成空白 提交于 2019-11-30 06:29:50
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-Watch-Series-2-42mm, watchOS 4.0 Apple-Watch-Series-3-38mm, watchOS 4.0 Apple-Watch-Series-3-42mm,

Ionic3 with woocommerce rest api having post request?

不羁的心 提交于 2019-11-30 06:05:20
问题 I am new to both woocommerce and Ionic and am trying to create an application with woocommerce as backend I have implemented the get request based rest apis in project but am unable to implement the apis with the post request.the function I tried to write for post request to woocommerce create order api is as follows. postOrder(postparams){ var headers = new Headers(); headers.append("Accept", 'application/json'); headers.append('Content-Type', 'application/json' ); headers.append('consumer

ngOnInit vs ionViewDidLoad in ionic 2 or ionic 2+

六眼飞鱼酱① 提交于 2019-11-30 05:52:25
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(); } 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 places for initializing the component's data. But for using ngOnInit you need to implement the Angular's

cannot find symbol import com.google.firebase.iid.FirebaseInstanceIdService error in ionic3

社会主义新天地 提交于 2019-11-30 05:31:20
问题 I Have no idea why I am getting this error whenever I try to create my app's build.I have tried many solutions but I was unable to solve this.i don't know if any plugins is causing issues or if there's any issue with my Code or firebase or firebase connectivity.I have deleted node modules and run npm install and removed and re-added android platform but still i am getting this error. import com.google.firebase.iid.FirebaseInstanceIdService; ^ symbol: class FirebaseInstanceIdService location:

Angular 2 Inheritance to enable disable Ionic Menu Swipe

喜你入骨 提交于 2019-11-30 05:30:55
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 inherited the base class. I have to write super() call in derived class constructor and pass the menu

ionic 3, lazy-loading tabs components

时光总嘲笑我的痴心妄想 提交于 2019-11-30 03:50:26
问题 I'm trying to create a ionic 3 tabs app with lazy loading without importing the components . in my app.component.ts rootPage:string = "Tabs"; in tabs.html <ion-tabs> <ion-tab [root]="Favorites" tabTitle="fav" tabIcon="star"></ion-tab> <ion-tab [root]="libaray" tabTitle="Library" tabIcon="book"></ion-tab> </ion-tabs> in Favorites.module.ts import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { Favorites } from './favorites'; @NgModule({ declarations

How to Include JS file in ionic 3

家住魔仙堡 提交于 2019-11-30 00:18:24
Im looking for a way to access a variable from external js file which i included in assets/data folder below is what i tried placed test.js in assets/data folder in test.js added variable testvar = "heloo from external js"; added script tag in src/index.html <script src="assets/data/test.js"></script> in app.component.ts i added this line after imports; declare var testvar: any; in constructor added this line to log the value console.log(testvar); result is error : ERROR ReferenceError: testvar is not defined so, how can i use my js variable in typescript ? This solution only worked for me Put

Disable swipe to view sidemenu ionic 2

a 夏天 提交于 2019-11-29 23:03:32
I'm using a sidemenu ionic 2. when I swipe this page from left to right the side menu slides out i need to disable sidemenu swipe in particular page. app.html <ion-menu [content]="content"> <ion-content> <ion-list> <button ion-item *ngFor="let p of pages" menuClose (click)="openPage(p)" > <ion-icon name="{{p.icon}}" item-left></ion-icon> {{p.title}} </button> </ion-list> </ion-content> </ion-menu> <ion-nav id="nav" [root]="rootPage" #content swipeBackEnabled="true"></ion-nav> page.html I went to disable swipemenu in this page, Disable only when i swipe import {Component} from '@angular/core';

Ionic 3 refer a new page in app module issue

╄→гoц情女王★ 提交于 2019-11-29 22:02:43
问题 I generated a new page in ionic 3 using the generate command. When I try adding it to the app module it throws the following error, Uncaught Error: Unexpected value 'NewTodo' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation. Previously while using ionic 2.x I never added annotations manually. Any idea how I can resolve it? UPDATE new-todo.ts file import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular