I am upgrading a large Angular 1.6 App and we have number of components which use 'require' to get access to parent component's controller. AngularJS component looks like:
var tileTextbox = {
template: '<ignore>',
controller: TileTextboxController,
bindings: {
field: '<',
notifyError: '&',
context: '<',
onRemoteFieldAction: '&',
onChange: '&'
},
require: {
formsCtrl: '^gsForm' ----> What should this be replaced with in Angular component?
}
};
I found @ViewChild which gives Parent access to Child but I am looking for other way around. I know we could refactor an use some sort of shared service but at this point I am just looking for minimal refactor. From Angular's documentation @ https://angular.io/guide/upgrade it does look like your component can use 'require' but just don't know how