fix: forgot about it
This commit is contained in:
@@ -1,24 +1,34 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from "@angular/common";
|
||||||
import { Component, Input, QueryList, ViewChildren } from '@angular/core';
|
import { Component, Input, OnInit, QueryList, ViewChildren } from "@angular/core";
|
||||||
import { TranslateData } from '../../dto/translate_data.dto';
|
import { NpsFile, TranslateData } from "../../dto/translate_data.dto";
|
||||||
import { TranslateBlockComponent } from '../translate_block/translate_block.component';
|
import { TranslateBlockComponent } from "../translate_block/translate_block.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-text-list',
|
selector: "app-text-list",
|
||||||
templateUrl: './text_list.component.html',
|
templateUrl: "./text_list.component.html",
|
||||||
styleUrls: ['./text_list.component.scss'],
|
styleUrls: ["./text_list.component.scss"],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule, TranslateBlockComponent],
|
imports: [CommonModule, TranslateBlockComponent],
|
||||||
})
|
})
|
||||||
export class TextListComponent {
|
export class TextListComponent implements OnInit {
|
||||||
@ViewChildren('translateBlock') translate_blocks: QueryList<TranslateBlockComponent> | null = null;
|
@ViewChildren("translateBlock") translate_blocks: QueryList<TranslateBlockComponent> | null =
|
||||||
|
null;
|
||||||
|
fileName = "";
|
||||||
elements_data: TranslateData[] = [];
|
elements_data: TranslateData[] = [];
|
||||||
@Input() set elements(el: TranslateData[]) {
|
@Input() set elements(el: TranslateData[]) {
|
||||||
this.elements_data = el;
|
this.elements_data = el;
|
||||||
localStorage.setItem('translations', JSON.stringify(this.elements_data));
|
localStorage.setItem("translations", JSON.stringify(this.elements_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
get elements() {
|
get elements() {
|
||||||
return this.elements_data;
|
return this.elements_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
const data = localStorage.getItem("original_file");
|
||||||
|
if (data) {
|
||||||
|
const file: NpsFile = JSON.parse(data);
|
||||||
|
this.fileName = file.file_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user