Setting Default Value for functions in AngularJs
<p>I want to set a default behavior for a function. If the function is passed it should execute that method otherwise should take a default method. Below is a code snippet which I am trying</p>

<pre><code>module.directive("zoll",function(){
  return{
    restrict:"EAC",
    scope:{
        displayName: "@",
        buttonClick: "&amp;"
    },
    template:"&lt;input type='button' id='cncl' value={{displayName}} ng-click='buttonClick()'&gt;",
    controller:function($scope){
        console.log($scope.buttonClick);

        if($scope.buttonClick === undefined){
            $scope.buttonClick = function () {
                alert("Inside Button");
            }
        }

    }
  }
});
</code></pre>