title: ng-click function in angular js
body: <p>Below is my code for ng-click. I want the click event to happen only once. I was thinking of adding comparison operator at the end but not sure. Please help as I am new to angular js. </p>
  
  <pre><code>&lt;html&gt;
  &lt;script 
  src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"&gt;
  &lt;/script&gt;
  &lt;body ng-app="myApp"&gt;
  &lt;div ng-controller="myCtrl"&gt;
  &lt;p&gt;Click the button to run a function:&lt;/p&gt;
  &lt;button ng-click="myFunc()"&gt;OK&lt;/button&gt;
  &lt;p&gt;The button has been clicked {{count}} times.&lt;/p&gt;
  &lt;/div&gt;
  &lt;script&gt;
  angular.module('myApp', [])
  .controller('myCtrl', ['$scope', function($scope) {
  $scope.count = 0;
  $scope.myFunc = function() {
    $scope.count++;
  };
  }]);
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>