These are chat archives for angular/angular-2-ionic-2

15th
Sep 2016
Rob Wormald
@robwormald
Sep 15 2016 01:03
(click)="doStuff($event)"
the-god
@iloveyo123u1
Sep 15 2016 05:55
Angular 2.0 Final Release Now Live!
Alex
@zefrench
Sep 15 2016 12:42
Hi everybody. I have a problem with my app using IONIC2. I thought that when a page is POP and so, the view is dismiss, the script on my .TS file is destroyed too. But it seems the script is still running even when I go back to the previous page.
How can I fix that ??
Kyle Roach
@iRoachie
Sep 15 2016 13:48
What's your script doing?
Asad Sahi
@asadsahi
Sep 15 2016 14:09
Hi guys, can't see any visibility on ionic 2 work with respect to Angular 2 final or since rc5 is released. Any ETA on next version of ionic 2?
Kyle Roach
@iRoachie
Sep 15 2016 14:11
Currently it's running on rc 4. The last update from the team is that they were working on the offline template compiler to make it work with ionic
There's still the transition to NgModule which came in rc5
Asad Sahi
@asadsahi
Sep 15 2016 14:14
hammm....I hope now to speedup things since Angular 2 is in binding contract of no more RCs :)
@iRoachie I heared in one of the postcasts as well, about team working on offline compilation, There wasn't any clear indication of release cycles with respect to angular2 final..
@robwormald do you have any news on ionic 2 next version?
Lebogang Mabala
@LMabala
Sep 15 2016 15:30
Anybody know how to download files with angular? I have a REST api which downloads a file at the "localhost:3000 /download/filename" I make an http request from my angular app. I want the file to be downloaded when I make that call. Anyone have an idea?
Kyle Roach
@iRoachie
Sep 15 2016 15:31
@LMabala This is what to you're looking for http://ionicframework.com/docs/v2/native/transfer/
Lebogang Mabala
@LMabala
Sep 15 2016 15:33
And on pure angular 2 in the browser? @iRoachie
Kyle Roach
@iRoachie
Sep 15 2016 15:52
@LMabala Why don't you just use an href to the link?
Alex
@zefrench
Sep 15 2016 16:15
@iRoachie my script is listening for some data in firebase. But i dont want these data be listen when the view is'nt active. I hope you can help me.
Kyle Roach
@iRoachie
Sep 15 2016 16:44
@zefrench You're using an observable to keep it in sync?
Alex
@zefrench
Sep 15 2016 18:16
No, these data are retrieve with a simple firebase on("value") function.
Kyle Roach
@iRoachie
Sep 15 2016 18:17
@zefrench any reason you aren't using angularfire? https://github.com/angular/angularfire2
Alex
@zefrench
Sep 15 2016 18:23
No reason. I use it in my app already but I don't see how to fix my problem with it.
Kyle Roach
@iRoachie
Sep 15 2016 18:27
@zefrench Angularfire's objects are observables which you subscribe to changes. There's an unsubscribe method you can call on the observable to stop receiving changes. You can then call unsubscribe in the ionViewWillLeave method that Ionic provides. It's called when someone is about to navigate away from the page
You can view more of the life cycle methods for pages here http://ionicframework.com/docs/v2/api/components/nav/NavController/
Alex
@zefrench
Sep 15 2016 18:32
Thanks a lot for this information. I'm going to check that.
Junus Ergin
@JunusErgin
Sep 15 2016 18:35
Hey there! :) What is the best way to start an Angular 2 Ionic App? Is there something similar to the Angular2-Seed project by mgechev or can i even use it as a base? https://github.com/mgechev/angular2-seed/issues?utf8=%E2%9C%93&q=ionic
Kyle Roach
@iRoachie
Sep 15 2016 18:36
@JunusErgin Ionic provides a cli to help you get everything together, http://ionicframework.com/docs/v2/getting-started/installation/
Remember to use the --v2 flag
Junus Ergin
@JunusErgin
Sep 15 2016 18:38
@iRoachie Thank you!! :)
Kyle Roach
@iRoachie
Sep 15 2016 18:38
@JunusErgin Glad i could help! :)
Alex
@zefrench
Sep 15 2016 20:25
@iRoachie It seems angularfire2 does not have a unsubscribe method.
Rob Wormald
@robwormald
Sep 15 2016 20:32
let userSubscription = af.database.list('/users').subscribe(...);
userSubscription.unsubscribe();
Asad Sahi
@asadsahi
Sep 15 2016 20:33
@robwormald do you know why angularfire2 beta 5 isn't visible on npmjs
Alex
@zefrench
Sep 15 2016 20:34
@robwormald I'm using this :
detailsOffer: FirebaseObjectObservable<any[]>
this.detailsOffer = this.af.database.object('offers/' + this.idOffer);
Can I use what you say ?
Rob Wormald
@robwormald
Sep 15 2016 20:36
this.detailsOffer there is an Observable, which does not have an unsubscribe method.
the act of subscribing to an observable returns a Subscriber, which is what you use to unsubscribe
Alex
@zefrench
Sep 15 2016 20:38
So, maybe I can do that:
detailsOffer: any;
this.detailsOffer = this.af.database.object('offers/' + this.idOffer).subscribe ?
Or is it a way to stop listening an observable ?
Rob Wormald
@robwormald
Sep 15 2016 21:16
you stop listening by unsubscribing.
if you're using the async pipe in ng2 you don't need to worry about it
Alex
@zefrench
Sep 15 2016 21:17
Thanks Rob.