import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

@Component({
  selector: 'ydlife-news-detail',
  templateUrl: './news-detail.component.html',
  styleUrls: ['./news-detail.component.scss']
})
export class NewsDetailComponent implements OnInit {
  type:string;
  constructor(private router:Router,private activatedRoute:ActivatedRoute) { 
    this.type = activatedRoute.snapshot.queryParams['type']
  }

  ngOnInit() {
    
  }

  close()
  {
    if(this.type==='1'){
      this.router.navigate(['/my'])
    }else{
      this.router.navigate(['/news'])
    }
  }

}
