Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html id="ng-app" ng-app="app">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-controller="demo as d">
   <div ng-click="d.click('parent',$event)">
     given some text for click
     <hr>
     <input type="checkbox" ng-model="d.stopPropagation" />Stop Propagation ?
     <hr>
     <button type="button" ng-click="d.click('button',$event)">button</button>
     
   </div>
</body>
</html>
 
angular.module("app",[])
.controller("demo",[function(){
  var vm = this;
  
  vm.click = function(name,$event){
    console.log(name +" -----called");
    if(vm.stopPropagation){
      $event.stopPropagation();
    }
  };
  
  return vm;
}]);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
greengerongpro
0viewers