I am facing a challenge that I haven't been able to find a solution for online.
My search form includes multiple instances of a common controller used for typeahead/autocomplete searches. Each controller is set up with different parameters for searching based on various criteria. The results of these searches need to be linked to a parent property in order to perform the search effectively. For example:
SearchController
CleanerId
TeacherId
StudentId
The child controller consists of a lookup control with an Id and Text value, where the Id must be assigned to the corresponding parent property.
My ideal scenario would be to bind the hidden id field of each controller to both the id of the child model and a separate property on the parent as shown below, but I'm uncertain if this is possible:
< input type="hidden" ng-model="child.Id, parent.CleanerId" />
< input type="hidden" ng-model="child.Id, parent.TeacherId" />
< input type="hidden" ng-model="child.Id, parent.StudentId" />
Given that the child controller needs to be generic, how can I ensure that the parent controller correctly binds to the child ids?
Any assistance would be highly appreciated.