Is there a built-in directive like ng-click that emits an event instead of calling a function? I want to do something like this:
HTML:
<button ng-click-emit="foo" ng-click-emit-model="model.bar">Emit foo</button>
Child:
$scope.model = {bar: 'baz'};
Parent controller:
$scope.$on('foo', function(event, arg) { console.log(arg);
angularjs
z0r
source share