It was possible to require NgModelController in AngularJS Components. Something like require:
// AngularJS component's definition
{
// ...
ngModel: '^'
// ...
}
Is it possible to require NgModelController (from AngularJS) instance in Angular Component (like it is possible in AngularJS).
I have a hybrid app. I want to use Angular Component in AngularJS component's template like:
<ng-form>
<a2-cmp ng-model="x"></a2-cmp>
</ng-form>
I had some AngularJS component which was using like:
<ng-form>
<a1-cmp ng-model="x"></a1-cmp>
</ng-form>
And inside of a1-cmp
component methods like $setViewValue
were used. So now I rewrote that component to Angular, but I need to support that mechanism of
syncing between inner and outer components. It was not problem because both (inner and outer) components were AngularJS. Now inner is Angular, but outer is AngularJS component.
Is it somehow possible? I need this to influence AngularJS NgForm instance state (pristine/validity) from Angular component's code.
There are different workarounds to do that (the most simple is to pass ngForm instance to Angular component and call methods)