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
Post a Comment