Here I created sample angular program for button click. but its not firing may i know where i did mistake? can any one help me on this.. thanks
var myApp = angular.module('myApp', []);
myApp.controller('MyCtrl', function($scope, $sce) {
$scope.buttonHtml = $sce.trustAsHtml("<button ng-click='showMessage(\"foo\")'>click me</button>");
$scope.showMessage = function(message) {
alert(message);
}
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp" ng-controller="MyCtrl">
<div ng-bind-html="buttonHtml"></div>
</div>