import { Component } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { Router } from '@angular/router';
import { CommonModule } from '@angular/common';
@Component({
  selector: 'app-story-generator',
  templateUrl: './story-generator.page.html',
  styleUrls: ['./story-generator.page.scss'],
  standalone: true,
  imports: [IonicModule, FormsModule,CommonModule],
})
export class StoryGeneratorPage {
  title: string = '';
  nameInput(e:any) {
    this.title = e.detail.value;
  }
  description: string = '';
  descripInput(e:any) {
    this.description = e.detail.value;
  }
  constructor(
    private router: Router,
  ) { }

  nextStep() {
    console.log('Title:', this.title); // 确保这里打印出正确的值
    console.log('Description:', this.description);
    this.router.navigate(['/chapter-generator'], {
      queryParams: { title: this.title, description: this.description }
    });
  }
}