Currently, I am utilizing a form component that includes common validation and saving functions. Inputs are injected into the form as transcluded templates in the following manner:
<form-editor entity="vm.entity">
<input ng-model="vm.dirtyEntity.name" required name="nameInput">
</form-editor>
The issue at hand is that the ng-model directive is creating a dirtyEntity field within the parent vm instead of affecting the component’s scope. Even defining the component's controller as "formVm" did not resolve this problem.
Is there a way to ensure that the ng-model on the transcluded element only changes the components' scope?
Alternatively, should interaction between the transcluded template and the component controller be avoided altogether and considered incorrect practice?