I am reading angular guide Directive section:https://docs.angularjs.org/guide/directive
When reading following code, I saw the string, 'close', appears in directive scope, which is different to something like customInfo I saw before. And I cannot find documents address this in detail. Presumably, it is to define a function for ng-click to call. However, I hope I could find more information about this.
.directive('myDialog', function() {
return {
restrict: 'E',
transclude: true,
scope: {
'close': '&onClose'
},
templateUrl: 'my-dialog-close.html'
};
});
BTW, here is the one not using string:
.directive('myCustomer', function() {
return {
restrict: 'E',
scope: {
customerInfo: '=info'
},
templateUrl: 'my-customer-iso.html'
};
});