You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
|
import { ItemForSaleService } from '../services/service.service';
|
|
import * as moment from 'moment';
|
|
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
|
@Component({
|
|
selector: 'app-item-details',
|
|
templateUrl: './item-details.component.html',
|
|
styleUrls: ['./item-details.component.scss'],
|
|
})
|
|
export class ItemDetailsComponent implements OnInit {
|
|
itemDetails: any = {};
|
|
direction: any;
|
|
|
|
constructor(public ts: TranslatorService, public cs: CommonService, private sanitizer: DomSanitizer,) { }
|
|
|
|
ngOnInit() {
|
|
this.direction = TranslatorService.getCurrentDirection();
|
|
this.itemDetails = this.cs.sharedService.getSharedData(ItemForSaleService.ITEMS_SELECTED, false);
|
|
console.log(this.itemDetails);
|
|
}
|
|
getDate(date) {
|
|
return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");
|
|
}
|
|
getImgContent(imgFile): SafeUrl {
|
|
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
|
|
}
|
|
}
|