viewdata.component.ts 1019 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { create } from 'domain';
import { ViewdataService } from '../service/viewdata.service';
import { catagory } from '../../catagory'; 
import { AuthService } from '@app/shared/services';
@Component({
  selector: 'app-viewdata',
  templateUrl: './viewdata.component.html',
  styleUrls: ['./viewdata.component.css']
})
export class ViewdataComponent implements OnInit {
  constructor(private route: ActivatedRoute, private reviewdataService: ViewdataService,private authService: AuthService) { }
  dataId: any;
  data: any;
  user_data: any;
  catagorys = catagory;
 
  ngOnInit(): void {
    this.authService.getUser().subscribe(data => this.user_data = data);
    this.route.paramMap.subscribe(params => {
      this.dataId = params.get('dataId');
    });
    this.reviewdataService.getReviewsById(this.dataId).subscribe(response => {
      this.data = response[0];
      console.warn(this.data);

    });

  }
}