0
說表達綁定我有一個複選框指令即時重寫到角從angularjs使用angularjs與降級角
checkbox.directive.js(angularjs)
template: `<some html> ...`,
scope: { checked: '=', onChecked: '&' }
checkbox.component。 TS(角)
@Component({
selector: 'checkbox',
templateUrl: '<some html> ...',
...
})
export class CheckboxComponent implements OnInit {
@Input() checked: boolean;
@Output() checkedChange = new EventEmitter<boolean>();
@Output() onCheckedChange = new EventEmitter<boolean>();
...
如何可以結合到t他還沒有升級組件的表達式綁定(&)?
還未upgraded.directive.js(angularjs)
template: '<checkbox (onChecked)="foo()"> ...',
controller: function($scope) {
$scope.foo = function() { console.log("change happened"); }
}