Reputation: 6461
I am trying to use ng-click
for both a div
and a span
and can't get it working for either.
<body ng-controller="MainCtrl">
<div ng-click="infoClicked('work_please')">
tony magoo
</div>
<div>
For general inquiries, please see our <span class = "highlight" ng-click = "infoClicked('work_span_please')">Frequently Asked Questions</span>
</div>
</body>
and...
var app = angular.module( 'plunker', [] );
app.controller('MainCtrl', function( $scope ) {
$scope.name = 'World';
$scope.infoClicked = function( message ) {
alert( message );
}
});
Here is the plunk
Upvotes: 4
Views: 26372
Reputation: 43947
You are missing the ng-app tag.
<body ng-app="plunker" ng-controller="MainCtrl">
Upvotes: 5