diff --git a/src/app/pages/specials/special/component/fix-bonus.component.ts b/src/app/pages/specials/special/component/fix-bonus.component.ts index a0c984a..4f042e1 100644 --- a/src/app/pages/specials/special/component/fix-bonus.component.ts +++ b/src/app/pages/specials/special/component/fix-bonus.component.ts @@ -1,12 +1,53 @@ -import { Component, OnInit } from '@angular/core'; +import { + Component, + OnInit, + ViewEncapsulation, + AfterViewInit, + ViewChild, + ElementRef +} from '@angular/core'; +import { + FormControl, + FormsModule, + ReactiveFormsModule, + FormGroup, + FormBuilder, + Validators, + NgControl, + NgForm, + FormArray +} from '@angular/forms'; +import { fuseAnimations } from 'src/@fuse/animations'; +import { Observable, of, fromEvent, Subject, BehaviorSubject } from 'rxjs'; @Component({ selector: 'app-fix-bonus', templateUrl: './fix-bonus.component.html', - styleUrls: ['./fix-bonus.component.scss'] + styleUrls: ['./fix-bonus.component.scss'], + encapsulation: ViewEncapsulation.None, + animations: fuseAnimations }) export class FixBonusComponent implements OnInit { - constructor() {} + public inputChange$: Subject = new Subject(); + public ClickedRowIndex: number = -1; + // public ClickedRow: cObject; currentRow: cObject; - ngOnInit() {} + public mtformgroup: FormGroup; + public mtformarray: FormArray; + + public dataSource; + + @ViewChild('filter', { static: true }) + filter: ElementRef; + + // Private + private _unsubscribeAll: Subject; + + constructor(private fb: FormBuilder) {} + + ngOnInit() { + this.mtformarray = this.fb.array([]); + this.mtformgroup = this.fb.group({ formarray: this.mtformarray }); + this.dataSource.formg = this.mtformgroup; + } } diff --git a/src/modules/special/fix-bonus/model/fix-bonus.model.ts b/src/modules/special/fix-bonus/model/fix-bonus.model.ts new file mode 100644 index 0000000..0460058 --- /dev/null +++ b/src/modules/special/fix-bonus/model/fix-bonus.model.ts @@ -0,0 +1,11 @@ +import { DateAudit } from 'src/modules/common/data/model/audit'; + +export interface FixBonus extends DateAudit { + id?: number; + gameType?: string; + gameDescription?: string; + userDescription?: string; + odds?: string; + folder?: number; + allow?: boolean; +} diff --git a/src/modules/special/fix-bonus/service/fix-bonus.service.ts b/src/modules/special/fix-bonus/service/fix-bonus.service.ts new file mode 100644 index 0000000..fcc768f --- /dev/null +++ b/src/modules/special/fix-bonus/service/fix-bonus.service.ts @@ -0,0 +1,18 @@ +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; +import { map, takeUntil } from 'rxjs/operators'; +import { FixBonus } from '../model/fix-bonus.model'; +import { API_BASE_URL } from 'src/modules/common/type/injection-token.type'; +import { FormArray } from '@angular/forms'; + +@Injectable({ + providedIn: 'root' +}) +export class FixBonusService { + constructor( + @Inject(API_BASE_URL) private apiBaseUrl: string, + private httpClient: HttpClient + ) {} +} diff --git a/src/modules/special/fix-bonus/service/index.ts b/src/modules/special/fix-bonus/service/index.ts new file mode 100644 index 0000000..01a8831 --- /dev/null +++ b/src/modules/special/fix-bonus/service/index.ts @@ -0,0 +1,3 @@ +import { FixBonusService } from './fix-bonus.service'; + +export const FIX_BONUS_SERVICES = [FixBonusService]; diff --git a/src/modules/special/special.module.ts b/src/modules/special/special.module.ts new file mode 100644 index 0000000..ab4f872 --- /dev/null +++ b/src/modules/special/special.module.ts @@ -0,0 +1,23 @@ +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FIX_BONUS_SERVICES } from './fix-bonus/service'; + +@NgModule({ + imports: [], + exports: [] +}) +export class SpecialRootModule {} + +@NgModule({ + declarations: [], + imports: [CommonModule], + exports: [] +}) +export class SpecialModule { + public static forRoot(): ModuleWithProviders { + return { + ngModule: SpecialRootModule, + providers: [FIX_BONUS_SERVICES] + }; + } +}