import { Component, OnInit } from '@angular/core';
import { NavParams, ModalController } from '@ionic/angular';

@Component({
  selector: 'app-news-detail',
  templateUrl: './news-detail.page.html',
  styleUrls: ['./news-detail.page.scss'],
})
export class NewsDetailPage implements OnInit {

  news: any;
  safeContent?: string;

  constructor(
    private navParams: NavParams,
    private modalController: ModalController
  ) {}

  ngOnInit() {
    this.news = this.navParams.get('news');
    this.safeContent = this.news.content; // 初始化 safeContent
  }

  dismiss() {
    this.modalController.dismiss();
  }
}



