ionic3

ScrollTo particular item of ListiVew in Ionic 2

早过忘川 提交于 2019-12-04 11:02:59
问题 I want to scrollTo a particular item in listview in ionic 2. I have a listview which is bound to array. export class TestPage { @ViewChild(Content) content: Content; public items: Array<Object> = []; ionViewWillEnter() { console.log(this.navParams.data); this.customService.getArray(this.params.index).then((items) => { this.items = items; //scroll to item // this.content.scrollTo() }); } } Here is the view: <ion-list [virtualScroll]="items" approxItemHeight="120px" approxItemWidth="100%" class

Ionic 3 not updating view

不想你离开。 提交于 2019-12-04 10:08:06
问题 Hi I got a function which will update after a http request to the server. It seems that the console.log show that the value has been updated but the UI is not updating unless I click on any other component(ex. input). This is my function: fileTransfer.upload(this.created_image, upload_url, options) .then((data) => { console.log("success:"+data.response); //This is showing correct response var obj = JSON.parse(data.response); this.sv_value = obj.value; console.log(this.sv_value); //This is

Ionic 3 Lazy Loading with amDateFormat pipe

爱⌒轻易说出口 提交于 2019-12-04 09:53:20
I am using Ionic3, and am in the process of converting to Lazy Loading in order to improve startup performance. I am experiencing a problem with pipes after converting my ChatsPage to lazy loading. As you can see below, it is complaining about the use of the following line in my chats.html . <h3 class="chat-time">{{item.timestamp | amDateFormat: 'D MMM YYYY'}}</h3> ERROR Error: Uncaught (in promise): Error: Template parse errors: The pipe 'amDateFormat' could not be found ("item.memberId2 && !item.lastMsg_read2))}">{{item.lastMsg_text}}</p> <h3 class="chat-time">{{[ERROR ->]item.timestamp |

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

↘锁芯ラ 提交于 2019-12-04 07:59:55
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 angular-cli twice but the error persists. Have been stuck with it for a long time any help is really

Changes are not getting reflected in Ionic 3 app even after successful build

别等时光非礼了梦想. 提交于 2019-12-04 06:44:10
问题 I met a problem for 3 days with my application ionic 3. In fact, after builder in prod and release mode, it is always the old version that is always taken into account. the changes do not reflect. So when mode debug, the changes are well taken. I tried several solutions may nothing. Ionic v3 Also i have tried many solutions but no changes ionic cordova platforms rm android ionic cordova platforms add android ionic cordova build android --prod --release --aot ------------no change-------------

Saving file to Downloads directory using Ionic 3

有些话、适合烂在心里 提交于 2019-12-04 06:42:58
i know this link: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/#where-to-store-files but i would like to save the file in Downloads directory. Is this possible to save the file in any path using Ionic? If so, please, share the example. Here's the code: downloadImage(image) { this.platform.ready().then(() => { const fileTransfer: TransferObject = this.transfer.create(); const imageLocation = `${cordova.file.applicationDirectory}www/assets/img/${image}`; fileTransfer.download(imageLocation, cordova.file.externalDataDirectory + image).then((entry) => { const

ionic3 - ERROR Error: Uncaught (in promise): Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'

旧时模样 提交于 2019-12-04 06:40:52
问题 I did a news comment function by ionic3 with firebase, after testing comment function working already, but when I want the comment showing in my project error coming out. ERROR Error: Uncaught (in promise): Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' My project follow this TUTORIAL. html file <ion-list> <ion-item-group *ngFor="let contact of contactsList | async"> <ion-item> {{contact.$value}} </ion-item> </ion-item-group> </ion-list> <ion-list> <ion-row> <ion-col col-6

How to orderBy the closest distance from current location in AngularFire2?

只谈情不闲聊 提交于 2019-12-04 05:17:25
问题 I am using AngularFire2 library to query in firebase. In my firebase, i have data collection and in them, i have many rows with latitude and longitude like below: - data - 1404033346513076_1998422263740845 - location - latitude: 23.7907795 - longitude: 90.403898 - 1404033346513076_1998422263740888 - location - latitude: 23.9907795 - longitude: 91.403898 I have the latitude and longitude of my current location and i have a helper function which can determine the distance in meters between the

Ionic 2 - Screen Flash

房东的猫 提交于 2019-12-04 04:48:00
问题 I have a login page and a homepage. I use native storage to set an item which will check if the user has already logged in or not (Facebook or Google authentication). If the item has a value (this check happens ins app.componenet.ts )it is directly navigated to homepage. Once a user logs in and if happens to minimize the app and after some period of time. When the user again opens the app,after few sec's of loading I get to see the login screen (which should not be visible as the user has

Unable to merge dex Ionic 3

回眸只為那壹抹淺笑 提交于 2019-12-04 04:34:16
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.DexArchiveMergerException: Unable to merge dex Try: Run with --stacktrace option to get the stack trace.