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

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -