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

16th
Sep 2016
Ashutosh Singh
@erashu212
Sep 16 2016 06:28

Hi

Any one is having idea about restricting page like canActivate in ionic2

Hi anyone can help me in terms providing restriction on page angular2 -ionic2
Ashutosh Singh
@erashu212
Sep 16 2016 06:36
Hi anyone can help me in terms providing restriction on page angular2 -ionic2
TinySmartMaster
@et-taousy
Sep 16 2016 07:21
Hi everyone I wanna just have some information how to deploy ionic project its automatically or I need apple, Windows and android account to upload my app thanks
Oscar Lagatta
@oscarlagatta
Sep 16 2016 09:36
Hi all, based on Analysis of user authentication for an angular website if; by dev ops restriction on the server that host the Angular application; what's best practice to gain access to the user authentication information logged into the domain ? this is similar as what a Microsoft project can do accessing to libraries to get the user information. What's the choice of accessing the user authentication information from the Angular Application if any? Many thanks
deanmiller
@deanmiller
Sep 16 2016 10:58
This may be a silly beginner question but if I downloaded angular CLI do I need to also download regular angular package from NPM.
I'm asking if the angular CLI package has all the bits I need.
Oscar Lagatta
@oscarlagatta
Sep 16 2016 11:48
@deanmiller angular cli when you execute from the command line ng new projectName will create all the structure and install all the relevant packages
deanmiller
@deanmiller
Sep 16 2016 12:04
@oscarlagatta thanks
Next question...
What does app.component.spec.ts do?
I never saw it before using the CLI
Oscar Lagatta
@oscarlagatta
Sep 16 2016 12:15
@deanmiller tests
Alex
@zefrench
Sep 16 2016 12:24

I still have a problem to unsubscribe on a firebase event.
Here is my code :
When the view appears, the script is launched and listening for an event in firebase
ionViewDidEnter() { this.statusOfferRef = this.af.database.object('/offers/' + this.idOffer + '/active', { preserveSnapshot: true });//we define the path to the actual status for this offers this.statusOfferRef.subscribe(snapshot => { this.statusOffer = snapshot.val(); if(this.statusOffer != false) { alert('false'); } }); }

And when the view is Pop this code would normally stop the firebase to be listen :
ionViewDidUnload() { alert('unload') this.statusOfferRef.unsubscribe(); }

But it does not works...
I tried with angularfire2 without result too.

Valentyn Shybanov
@olostan
Sep 16 2016 12:29
Seems we can use release version of Angular 2? ( https://github.com/driftyco/ionic/blob/master/package.json ) Anyone used?
@zefrench I am using ionViewWillLeave to unsubscribe... not very convinient (I need to unsubscribe on mostly all views) but it works
Alex
@zefrench
Sep 16 2016 12:33
So, @olostan you mean I have to replace ionViewDidUnload by IonViewWilLeave ?
Valentyn Shybanov
@olostan
Sep 16 2016 12:34
try. works for me
Alex
@zefrench
Sep 16 2016 12:51
No, it does not... Maybe it's cos I'm using ionViewDidEnter to launch the listen
ionViewDidEnter() {
this.statusOfferRef = this.af.database.object('/offers/' + this.idOffer + '/active', { preserveSnapshot: true });//we define the path to the actual status for this offers
this.statusOfferRef.subscribe(snapshot => {
this.statusOffer = snapshot.val();
if(this.statusOffer != false) {
alert('false');
}
});
}
Valentyn Shybanov
@olostan
Sep 16 2016 12:52
But do you store somewhere subscription to unsubscribe?
Alex
@zefrench
Sep 16 2016 12:52
The subscription is launched here : this.statusOfferRef.subscribe(snapshot => {
Valentyn Shybanov
@olostan
Sep 16 2016 12:53
But to unsubscribe from it, you need to store result somewhere and unsubscribe when leaving
I do it such way: each my view has private subscriptions: any[]. When I subscribe i push there like this.subscriptions.push(someRef.subscribe(...)) and on leave I do this.subscriptions.forEach( (s) => s.unsubscribe() )
Alex
@zefrench
Sep 16 2016 12:56
No, I don't have that.
Only the code I show you.
Valentyn Shybanov
@olostan
Sep 16 2016 12:56
Try. That works for me. Each time view enter I subscribe and when leave I unsubscribe
Alex
@zefrench
Sep 16 2016 13:18
I don't figure out how to implement your code. Do you use firebase js or angularfire ?
Guy Guidona
@Guidona
Sep 16 2016 17:25
I've à problem, when trying to apply bootstrap on my web app, this doesn't give at all
malik415
@malik415
Sep 16 2016 21:20
First time on the site so please excuse me if I'm blurting out or asking a question in a way that is frowned up. I'm new to Angular and using Angular2/Ionic 2 and I'm trying to use some code that is throwing this error: Visual Studio 2015/Projects/myappproject/node_modules/@angular/forms/index"' has no exported member 'FormsModule'. TypeScript Virtual Projects C:\Users\xxxxx\DownloadJRE\Documents\Visual Studio 2015\Projectsmyappproject\app\app.ts 6 Active
In my app.ts file I have this line: import { FormsModule, ReactiveFormsModule} from '@angular/forms'; but it'
but it's as if some dependency or something is missing... any ideas
Kyle Roach
@iRoachie
Sep 16 2016 21:22
Make sure you're using angular 2 version RC 5 or higher
Modules were introduced in RC5
malik415
@malik415
Sep 16 2016 23:20
What is the best way to upgrade to RC5. If there are instructions online somewhere I'm happy to look myself
or if you know off hand @iRoachie
my package.json file shows "2.0.0-rc.5" for the various @angular parts under the dependencies section, but I still get the error has no exported member "FormsModule"