I can call the function from my directive but the parameter keeps being passed as undefined.
Here's the line from the directive
<input ng-click="delete(0)" type="submit" id="submit" value="Delete Feed" />
and here's the directive
<testdirective delete="deleteFeed()"></testdirective>
And here's the function
$scope.deleteFeed = function(x){
console.log(x);
$scope.tweets.splice(x, 1);
}
and finally the directive itself
app.directive("testdirective", function() {
return {
restrict: "E",
templateUrl: 'app/main/tweetboard.html',
scope: {
delete:'&'
},
};
});
Thanks!
deleteis reserved in JS, could be causing some issues.