I am trying to use ng-click for both div and span and cannot make it work.
<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 plunk
source share