I'm trying to make an application that has some data-driven UI. So, I'm trying to pass in a function that should be called when a button is clicked. The second button works, of course, as it explicitly calls the function. However, the first one doesn't. Here's the angular js code:
$scope.clickFunction = "clickedIt()";
$scope.clickedIt = function(){
alert("It worked!");}
And the html:
<p>How can I make this button call a passed-in function?</p>
<button ng-click="{{clickFunction}}">Click Me</button>
<p>I'd like it to evaluate to this, which works.</p>
<button ng-click="clickedIt()">Click Me</button>
Here's a plunker with the code I'm try to make work. http://plnkr.co/edit/aRBX3bbgHCV15mgROZx1?p=preview