Say i have a checkbox directive i'm rewriting to angular from angularjs
checkbox.directive.js (angularjs)
template: `<some html> ...`,
scope: { checked: '=', onChecked: '&' }
checkbox.component.ts (angular)
@Component({
selector: 'checkbox',
templateUrl: '<some html> ...',
...
})
export class CheckboxComponent implements OnInit {
@Input() checked: boolean;
@Output() checkedChange = new EventEmitter<boolean>();
@Output() onCheckedChange = new EventEmitter<boolean>();
...
How can i bind to the expression binding (&) from not yet upgraded components?
not-yet-upgraded.directive.js (angularjs)
template: '<checkbox (onChecked)="foo()"> ...',
controller: function($scope) {
$scope.foo = function() { console.log("change happened"); }
}