在此代碼:在角度上,指令中的&符號是什麼意思?
app.directive('myCustomDirective', function() {
return {
restrict: 'EA',
scope: { value: '=myCustomDirective', clickable: '&', editing: '=' },
template: '<span ng-click="handleClick()" ng-bind="value"></span>',
...
是什麼clickable: '&'
表示?
當我找到Angular文檔時,我無法理解它。它似乎寫在一個catch-22代碼中,只有那些已經理解了解釋內容的人才能理解。
例如,我發現this video,這顯然解釋了&的事情,但他可能會說普通話。
我與你在API文檔。如果你是初學者,它與MSDN一樣有幫助(閱讀:不是很有幫助)。 –