From 55f84dccbaa17476784532f5f21f3c9735e133fd Mon Sep 17 00:00:00 2001 From: byung eun park Date: Thu, 19 Sep 2019 18:49:23 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=A0=EC=A0=95=20=EB=B3=B4=EB=84=88?= =?UTF-8?q?=EC=8A=A4=20=EB=AA=A8=EB=93=88=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../special/component/fix-bonus.component.ts | 49 +++++++++++++++++-- .../fix-bonus/model/fix-bonus.model.ts | 11 +++++ .../fix-bonus/service/fix-bonus.service.ts | 18 +++++++ .../special/fix-bonus/service/index.ts | 3 ++ src/modules/special/special.module.ts | 23 +++++++++ 5 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 src/modules/special/fix-bonus/model/fix-bonus.model.ts create mode 100644 src/modules/special/fix-bonus/service/fix-bonus.service.ts create mode 100644 src/modules/special/fix-bonus/service/index.ts create mode 100644 src/modules/special/special.module.ts 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] + }; + } +}