Skip to content

Instantly share code, notes, and snippets.

@k0d3d
Last active May 21, 2019 01:53
Show Gist options
  • Save k0d3d/9003a42d6d089a8dea9f96a094883490 to your computer and use it in GitHub Desktop.
Save k0d3d/9003a42d6d089a8dea9f96a094883490 to your computer and use it in GitHub Desktop.
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