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

10th
Nov 2017
Luke Skelhorn
@SCRATK
Nov 10 2017 10:02
I’m getting this error Uncaught SyntaxError: missing ) after argument list which is on like 370 which is this line .subscribe(token => { which is part of the code and i cannot understand why its not working
doLogin(){
    this.authProvider.login(this.loginForm)
    // .map(data => {
    //   return data.json()
    // })
    .subscribe(
      token => {
        this.storage.set('hasLoggedIn', true);
        this.storage.set('access_token', token.access_token);
        this.storage.set('role_id', token.role_id);
        if (token.last_login_date === null){
          this.storage.set('last_login_date', false);
          console.log(token.last_login_date);
        } else {
          this.storage.set('last_login_date', true);
        }
      },
      error => {
        this.invalidLogin = true;
      },
Narendra
@NarenShalem
Nov 10 2017 17:38
can you please me any example of ionic angular parent to child property binding ...........
i have tried it only angular it works
but in ionic i getting errors
@UncertaintyP hii
can please help me
is any one
UncertaintyP
@UncertaintyP
Nov 10 2017 17:51
[property]="value" where value is a property of parent
Narendra
@NarenShalem
Nov 10 2017 17:59
image.png
@UncertaintyP can please see it here
page-card my child card
UncertaintyP
@UncertaintyP
Nov 10 2017 18:00
And page-card has an @Input() person; ?
Narendra
@NarenShalem
Nov 10 2017 18:01
ya i have added

import { Component,NgZone,OnInit,Input} from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

@IonicPage()
@Component({
selector: 'page-grid',
templateUrl: 'grid.html',
})
export class GridPage implements OnInit {
@Input() person:any;

constructor(public navCtrl: NavController, public navParams: NavParams,public ngZone:NgZone) {
this.person = this.navParams.get('person');
}

ionViewDidLoad() {
}
ngOnInit() {

}
}

UncertaintyP
@UncertaintyP
Nov 10 2017 18:02
This is page-grid not page-card
Also: you defined @Input() person but you set person later to navParams.get('person') this makes no sense
Narendra
@NarenShalem
Nov 10 2017 18:05
sry Tq for ur response once again.........
i have another approach
from navParams
now i am re checking everything tq..
Narendra
@NarenShalem
Nov 10 2017 18:45
@UncertaintyP some isuue
<page-grid ng-reflect-person="[object Object]"> in the browser
UncertaintyP
@UncertaintyP
Nov 10 2017 18:57
What's the problem?
Narendra
@NarenShalem
Nov 10 2017 19:00
image.png
i am getting
data is not redering
This is my parent

export class PlayersPage {

people: Array<any> =[{
name:"Narendra",
add:"hyd"
}, {
name:"Ajay",
add:"hyd"
}, {
name:"Viajy",
add:"hyd"
}, {
name:"Koti",
add:"hyd"
}]

<ion-row>
<ion-col *ngFor ="let p of people">
<page-grid [person]="p"></page-grid>
</ion-col>
</ion-row>
templte
UncertaintyP
@UncertaintyP
Nov 10 2017 19:22
So you have a component which is actually an IonicPage?
Narendra
@NarenShalem
Nov 10 2017 19:30
yes
@UncertaintyP
Narendra
@NarenShalem
Nov 10 2017 19:42
if possible pls explain it