Last active
May 21, 2019 01:53
-
-
Save k0d3d/9003a42d6d089a8dea9f96a094883490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | |
import { BoardService } from '../../services/board/board.service' | |
@Component({ | |
selector: 'app-sport-category', | |
templateUrl: './sport-category.component.html', | |
styleUrls: ['./sport-category.component.scss'] | |
}) | |
export class SportCategoryComponent implements OnInit {y | |
@Input() parentForm // input decorator | |
@Input() fieldof | |
list | |
constructor( | |
private boardSvc: BoardService | |
) { | |
boardSvc.getSportsCategory().subscribe(sc => this.list = sc) | |
} | |
ngOnInit() { | |
} | |
pickedSport ($e) { | |
this.parentForm.patchValue({ | |
[this.fieldof]: $e.detail.value | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment