import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import * as Parse from 'parse';
import { NavComponent } from '../../app/components/nav/nav.component';
import { ionicStandaloneModules } from '../ionic-standalone.modules';

@Component({
  selector: 'app-webview',
  templateUrl: './webview.component.html',
  styleUrls: ['./webview.component.scss'],
  standalone: true,
  imports: [...ionicStandaloneModules, NavComponent],
})
export class WebviewComponent implements OnInit {
  article:Parse.Object;
  constructor(private activateRoute: ActivatedRoute) { }

  ngOnInit() {
    this.activateRoute.paramMap.subscribe(async (params) => {
      let id: any = params.get('id');
      let query = new Parse.Query('Article');
      this.article = await query.get(id);
    })
  }

}
