I have a table that contains users records. There is a column for "tags" that allow you to tag the record with one or more values.
For this, I created an edit button on the row. Once clicked, I show a component that I have wrapped in an ngIf
.
<span *ngIf="inEditMode(r.RuleParentID, a.AttributeID)">
<app-inline-select [selected]="a" [source]="fetchSourceList(a.AttributeID)" [ruleParentID]="r.RuleParentID" [attributeID]="a.AttributeID"></app-inline-select>
</span>
The included component
utilizes Select2 allowing for a multi-select input field.
This is all working just fine. However, I now need to add a Save Button
in my parent component that will send some data off to my service. I need the data from this included component though.
During some research, I thought that ViewChild
may have been an option but this component is on the page multiple times within an ngFor
loop so it's essentially dynamic not allowing me to call it by name directly which is what ViewChild
would need.
How could I go about getting data? The save button is unrelated to the included component it self.