import { Component, OnInit,Input} from '@angular/core';
import {Subscription}   from 'rxjs';
import {DataService} from '../data.service';
@Component({
  selector: 'app-askdetail',
  templateUrl: './askdetail.component.html',
  styleUrls: ['./askdetail.component.css']
})
export class AskdetailComponent implements OnInit {
  @Input() curPageData: Array<any>;
  questionList:Array<any>;
  answerList:Array<any>;
  subscription: Subscription;
  constructor(
    private dataService:DataService
  ) {
    this.answerList = this.dataService.answerList;
    this.subscription = dataService.answerList$.subscribe(
      answerList => {
        this.answerList = answerList;
      });
   }

   ngOnInit() {
    console.log(this.curPageData)

  }
}
