I'm currently in the process of developing a versatile search box component, with the following setup:
search.component.html
<div class="search-box-container">
<fa-icon class="search-icon" [icon]="faSearch"></fa-icon>
<input type="search" name="search" class="search-box" autocomplete="off" />
</div>
search.component.ts
import { Component, OnInit } from '@angular/core';
import { faSearch } from '@fortawesome/free-solid-svg-icons'
@Component({
selector: 'app-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss']
})
export class SearchComponent implements OnInit {
faSearch = faSearch;
constructor() { }
ngOnInit() {
}
}
My goal is to use this component across various other components in the application like so:
<app-search [ngModel]="searchString" (onUpdate)="updateSearch"></app-search>
At this point, I am questioning how I can access and manipulate the parent ngModel and onUpdate properties that are defined in the main component within a nested component structure.