Liên kết phương thức phần tử chỉ thị AngularJS - TypeError: Không thể sử dụng toán tử 'in' để tìm kiếm 'functionName' trong 1
Đây là bộ điều khiển của mẫu chính: app.controller('OverviewCtrl', ['$scope', '$location', '$routeParams', 'websiteService', 'helperService', function($scope, $location, $routeParams, websiteService, helperService) { ... $scope.editWebsite = function(id) { $location.path('/websites/edit/' + id); }; }]); Đây là chỉ thị: app.directive('wdaWebsitesOverview', function() { return { restrict: 'E', scope: { heading: '=', websites: '=', editWebsite: '&' }, …