This is the controller of the main template:
app.controller('OverviewCtrl', ['$scope', '$location', '$routeParams', 'websiteService', 'helperService', function($scope, $location, $routeParams, websiteService, helperService) {
...
$scope.editWebsite = function(id) {
$location.path('/websites/edit/' + id);
};
}]);
This is the directive:
app.directive('wdaWebsitesOverview', function() {
return {
restrict: 'E',
scope: {
heading: '=',
websites: '=',
editWebsite: '&'
},
templateUrl: 'views/websites-overview.html'
}
});
This is how the directive is applied in main template:
<wda-websites-overview heading="'All websites'" websites="websites" edit-website="editWebsite(id)"></wda-websites-overview>
and this is method is called from directive template (website-overview.html):
<td data-ng-click="editWebsite(website.id)">EDIT</td>
QUESTION: When EDIT is clicked, this error appears in the console:
TypeError: Cannot use 'in' operator to search for 'editWebsite' in 1
Does anyone know what goes on here?