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

20th
Sep 2016
Frank Cooke
@platypusrex
Sep 20 2016 03:33
anyone know the proper way to unsubscribe from an event when using anon function?
import { Events } from 'ionic-angular';

constructor(public events: Events) {}

// first page (publish an event when a user is created)
function createUser(user) {
  console.log('User created!')
  events.publish('user:created', user);
}

// second page (listen for the user created event)
events.subscribe('user:created', (userEventData) => {
  // userEventData is an array of parameters, so grab our first and only arg
  console.log('Welcome', userEventData[0]);
});
adirzoari
@adirzoari
Sep 20 2016 14:05
Hello, I have problem while I install npm angularfire2 firebase@2.4.2 --save
this is the error I get
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN angularfire2@2.0.0-beta.5-preview requires a peer of @angular/common@^2.0.0 but none was installed.
npm WARN angularfire2@2.0.0-beta.5-preview requires a peer of @angular/compiler@^2.0.0 but none was installed.
npm WARN angularfire2@2.0.0-beta.5-preview requires a peer of @angular/core@^2.0.0 but none was installed.
npm WARN angularfire2@2.0.0-beta.5-preview requires a peer of @angular/platform-browser@^2.0.0 but none was installed.
npm WARN angularfire2@2.0.0-beta.5-preview requires a peer of @angular/platform-browser-dynamic@^2.0.0 but none was installed.
npm WARN angularfire2@2.0.0-beta.5-preview requires a peer of @types/request@0.0.30 but none was installed.
npm WARN angularfire2@2.0.0-beta.5-preview requires a peer of rxjs@5.0.0-beta.12 but none was installed.
npm WARN ionic-hello-world@ No repository field.
npm WARN ionic-hello-world@ No license field.
Asad Sahi
@asadsahi
Sep 20 2016 14:06
why are you targeting firebase@2.4.2?
I think latest one is 3.xxx
adirzoari
@adirzoari
Sep 20 2016 14:14
I tried also write install npm angularfire2 and get the problem
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
what is mean??
Frank Cooke
@platypusrex
Sep 20 2016 14:17
I've never gotten a response in this room. Sup with that?
Juan Heredia
@jherediagu
Sep 20 2016 19:08
when ionic release the next beta? and the release candidate????
G
@gravity-addiction
Sep 20 2016 19:57
i think ionic is a bit far away from any sort of release candidates.. beta.12 gets things upto par with ng2 release.
Juan Heredia
@jherediagu
Sep 20 2016 20:03
@gravity-addiction when its released ng2?
G
@gravity-addiction
Sep 20 2016 20:05
angular2.0.0 official release was last wednesday / thursday
Juan Heredia
@jherediagu
Sep 20 2016 20:19
@gravity-addiction maybe this weekend it can be released?
G
@gravity-addiction
Sep 20 2016 20:23
ionic beta.12 will be dropping soon, https://github.com/driftyco/ionic/milestone/41 looks promising
Juan Heredia
@jherediagu
Sep 20 2016 20:39
niceeee !! :)
adirzoari
@adirzoari
Sep 20 2016 22:07
hello
I have problem
I create one component called login

import {Component, OnInit} from '@angular/core';
import { NavController } from 'ionic-angular';
import { HttpService } from '../../providers/HttpService';
import {Response} from "@angular/http";

/*
Generated class for the LoginPage page.

See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
templateUrl: 'build/pages/login/login.html',
})
export class LoginPage {

httpService: HttpService;
data2:any;

constructor(private navCtrl: NavController) {
this.data2={};
this.data2.username="";
this.data2.password="";
}

getD(){
this.httpService.getData().subscribe(
(data:Response)=>console.log(data)
);
}

login() {
let username = this.data2.username;
let password = this.data2.password;
}

}

and one service

/**

  • Created by Adir on 21/09/2016.
    */
    import { Injectable } from '@angular/core';
    import { Http } from '@angular/http';
    import 'rxjs/add/operator/map';

/*
Generated class for the MyService provider.

See https://angular.io/docs/ts/latest/guide/dependency-injection.html
for more info on providers and Angular 2 DI.
*/
@Injectable()
export class HttpService {

constructor(private http: Http) {}
getData(){
    return this.http.get('https://devactic-firebase.firebaseio.com/title.json');
}

}

but the login component doesn't know the function of Httpservice
the getData()
why that?