import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'

@Component({
  selector: 'app-page4',
  templateUrl: './page4.component.html',
  styleUrls: ['./page4.component.css']
})
export class Page4Component implements OnInit {
  @Input() curPageData: Array<any>
  @Output() getAllAnswer = new EventEmitter<any>()
  selectedNum:number;
  constructor() {}

  ngOnInit() {
    console.log(this.curPageData)
  }
  getAnswer(option) {
    const ret = {
      pageId: this.curPageData['pageId'],
      questions: [
        {
          questionId: this.curPageData['questions'][0].questionId,
          option: [option]
        }
      ]
    }
    this.getAllAnswer.emit(ret)
  }
  changeStyle(optionId){
    //当前选中项
    this.selectedNum = optionId
  }
}
