You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Component, OnInit, Input } from '@angular/core';
|
|
|
|
import { NzModalRef } from 'ng-zorro-antd/modal';
|
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
@Component({
|
|
|
|
selector: 'app-editor',
|
|
|
|
templateUrl: './editor.component.html',
|
|
|
|
styleUrls: ['./editor.component.scss']
|
|
|
|
})
|
|
|
|
export class EditorComponent implements OnInit {
|
|
|
|
|
|
|
|
@Input() data?: any;
|
|
|
|
validateForm!: FormGroup;
|
|
|
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
|
|
|
|
|
|
|
|
datacopy:any
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.validateForm = this.fb.group({
|
|
|
|
name: [null, [Validators.required]],
|
|
|
|
code: [null, [Validators.required]]
|
|
|
|
});
|
|
|
|
this.datacopy = JSON.parse(JSON.stringify(this.data))
|
|
|
|
}
|
|
|
|
destroyModal(): void {
|
|
|
|
this.modal.destroy({ data: 'this the result data' });
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|