import { Component } from '@angular/core';
import { IonicPage, NavController } from 'ionic-angular';
import {  Response } from '@angular/http';
import { JoinDetailPage } from '../joinDetail/joinDetail';
import {AppService} from "../../../../service/http.service";

@IonicPage()
@Component({
  selector: 'page-activityTrack',
  templateUrl: 'activityTrack.html',
})
export class ActivityTrackPage {

  activityList: object[];
  
 
  constructor(
    public navCtrl: NavController,
    public appService: AppService,
  ) {

  }

  ngOnInit() {
    this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/findAllActivityForTraceList",null)
    .subscribe((res: Response) => {
        let resultback = res.json();
        this.activityList = resultback           
      }, error => {        
      }
    );
  }

  goDetail(item) {
    this.navCtrl.push("JoinDetailPage",{id:item.id,name:item.activityName});
  }

  goBack(){
    this.navCtrl.popToRoot();
  }
}
