angularjs - Is there any performance difference between $emit event and casual function call in ng-click? -


<script>   angular.app('app', [])   .controller('ctrl', function($scope) {      $scope.$on('foo', function(evt, msg) {          alert(msg);       });      $scope.foo = function(msg) {           alert(msg);       };     }); </script> <div ng-app="app"> <div ng-controller="ctrl"> <button ng-click="foo('some msg')">call</button> <button ng-click="$emit('foo')">emit</button> </div> </div> 

is there significant performance different between 2 cases? case should go by?


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -