website/src/app/formulaManager/viewComponents/viewComponents.component.ts
2019-02-06 21:34:56 -05:00

26 lines
726 B
TypeScript

import {Component} from '@angular/core';
import {MatDialog} from '@angular/material';
import {DeleteComponent} from '../../delete/delete.component';
import {NewComponentComponent} from '../newComponent/newComponent.component';
import {AppStore} from '../../app.store';
@Component({
selector: '',
templateUrl: './viewComponents.component.html'
})
export class ViewComponents {
constructor(private dialog: MatDialog, public store: AppStore) {}
createComponent(component?) {
if (component) {
this.dialog.open(NewComponentComponent, {data: component});
} else {
this.dialog.open(NewComponentComponent);
}
}
delete(component) {
this.dialog.open(DeleteComponent, {data: component});
}
}