Angular: Looking for an explanation on custom directive syntax
问题 I copied a custom directive that watches for changes on form file inputs. angular.module('customDirective', []) .directive('ngFileInputChange', function() { return { restrict: 'A', link: function (scope, element, attrs) { var onChangeHandler = scope.$eval(attrs.ngFileInputChange); element.bind('change', onChangeHandler); } }; }); Then I use it in the template like so: <input ng-model="vm.image" ng-file-input-change="vm.base64Test" ...> And this works fine. However, this doesn't work: <input