Advertisement
Guest User

proponent

a guest
Dec 8th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.96 KB | None | 0 0
  1. import { Component, OnInit, ChangeDetectorRef, Inject } from '@angular/core';
  2. import { Location } from "@angular/common";
  3. import { Store } from '@ngrx/store';
  4. import { AppState } from '../../../shared/metronic/core/reducers';
  5. import { Router, ActivatedRoute } from '@angular/router';
  6. import { FormBuilder } from '@angular/forms';
  7. import { AlertMessageService } from '../../../shared/components/alert-message/alert-message.service';
  8. import { SubheaderService, LayoutConfigService } from '../../../shared/metronic/core/_base/layout';
  9. import { CrudEditComponent, CrudEditComponentHtml } from '../../../shared/components/pages/crud/edit/crud-edit.component';
  10. import { TypesUtilsService, LayoutUtilsService } from '../../../shared/metronic/core/_base/crud';
  11. import { DialogMessageService } from '../../../shared/components/dialog-message/dialog-message.service';
  12. import { INovaValidators } from '../../../shared/validators';
  13.  
  14.  
  15. import { Proponent } from '../models/proponent.model';
  16. import { ProponentService } from '../services/proponent.service';
  17.  
  18. @Component({
  19.     selector: 'inova-proponent-edit-component',
  20.     template: CrudEditComponentHtml(require('!!raw-loader!./proponent-edit.component.html')),
  21.     styleUrls: ['../../../shared/components/pages/crud/edit/crud-edit.component.scss','./proponent-edit.component.scss'],
  22. })
  23. export class ProponentComponent extends CrudEditComponent<Proponent, ProponentService> {
  24.     constructor(public proponentService: ProponentService,
  25.         protected store: Store<AppState>,
  26.         protected activatedRoute: ActivatedRoute,
  27.         protected router: Router,
  28.         protected typesUtilsService: TypesUtilsService,
  29.         protected formBuilder: FormBuilder,
  30.         public dialog: DialogMessageService,
  31.         public subheaderService: SubheaderService,
  32.         protected layoutUtilsService: LayoutUtilsService,
  33.         protected layoutConfigService: LayoutConfigService,
  34.         protected alertMessageService: AlertMessageService,
  35.         protected cdr: ChangeDetectorRef,
  36.         protected location: Location, ) {
  37.         super(proponentService, store, activatedRoute,
  38.             router, typesUtilsService,
  39.             formBuilder, dialog,
  40.             subheaderService,
  41.             layoutUtilsService,
  42.             layoutConfigService,
  43.             alertMessageService,
  44.             cdr,
  45.             location, 'Proponente')
  46.     }
  47.     ngOnInit(): void {
  48.         this.setFormGroup({
  49.             city: [this.model.city, INovaValidators.required],
  50.             email: [this.model.email, [INovaValidators.required, INovaValidators.email]],
  51.             name: [this.model.name, INovaValidators.required],
  52.             cpfCnpj: [this.model.cpfCnpj, [INovaValidators.required, INovaValidators.cpfCnpjValidator]]
  53.         });
  54.         this.proponentService.getAll();
  55.         debugger;
  56.         super.ngOnInit();
  57.     }
  58.  
  59.     ngAfterViewInit(): void {
  60.        
  61.         this.showBtnVoltar = true;
  62.         super.ngAfterViewInit();
  63.     }
  64.  
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement