javascript - Cannot get ng-click working for either div or span -
i trying use ng-click
both div
, span
, can't working either.
<body ng-controller="mainctrl"> <div ng-click="infoclicked('work_please')"> tony magoo </div> <div> 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 plunk
you missing ng-app tag.
<body ng-app="plunker" ng-controller="mainctrl">
Comments
Post a Comment