Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit, ChangeDetectorRef, Inject } from '@angular/core';
- import { Location } from "@angular/common";
- import { Store } from '@ngrx/store';
- import { AppState } from '../../../shared/metronic/core/reducers';
- import { Router, ActivatedRoute } from '@angular/router';
- import { FormBuilder } from '@angular/forms';
- import { AlertMessageService } from '../../../shared/components/alert-message/alert-message.service';
- import { SubheaderService, LayoutConfigService } from '../../../shared/metronic/core/_base/layout';
- import { CrudEditComponent, CrudEditComponentHtml } from '../../../shared/components/pages/crud/edit/crud-edit.component';
- import { TypesUtilsService, LayoutUtilsService } from '../../../shared/metronic/core/_base/crud';
- import { DialogMessageService } from '../../../shared/components/dialog-message/dialog-message.service';
- import { INovaValidators } from '../../../shared/validators';
- import { Proponent } from '../models/proponent.model';
- import { ProponentService } from '../services/proponent.service';
- @Component({
- selector: 'inova-proponent-edit-component',
- template: CrudEditComponentHtml(require('!!raw-loader!./proponent-edit.component.html')),
- styleUrls: ['../../../shared/components/pages/crud/edit/crud-edit.component.scss','./proponent-edit.component.scss'],
- })
- export class ProponentComponent extends CrudEditComponent<Proponent, ProponentService> {
- constructor(public proponentService: ProponentService,
- protected store: Store<AppState>,
- protected activatedRoute: ActivatedRoute,
- protected router: Router,
- protected typesUtilsService: TypesUtilsService,
- protected formBuilder: FormBuilder,
- public dialog: DialogMessageService,
- public subheaderService: SubheaderService,
- protected layoutUtilsService: LayoutUtilsService,
- protected layoutConfigService: LayoutConfigService,
- protected alertMessageService: AlertMessageService,
- protected cdr: ChangeDetectorRef,
- protected location: Location, ) {
- super(proponentService, store, activatedRoute,
- router, typesUtilsService,
- formBuilder, dialog,
- subheaderService,
- layoutUtilsService,
- layoutConfigService,
- alertMessageService,
- cdr,
- location, 'Proponente')
- }
- ngOnInit(): void {
- this.setFormGroup({
- city: [this.model.city, INovaValidators.required],
- email: [this.model.email, [INovaValidators.required, INovaValidators.email]],
- name: [this.model.name, INovaValidators.required],
- cpfCnpj: [this.model.cpfCnpj, [INovaValidators.required, INovaValidators.cpfCnpjValidator]]
- });
- this.proponentService.getAll();
- debugger;
- super.ngOnInit();
- }
- ngAfterViewInit(): void {
- this.showBtnVoltar = true;
- super.ngAfterViewInit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement