Skip to main content

[SOLVED] Angularjs components – How to pass-in arguments in callbacks

It’s pretty straightforward but not very clear in the documentation, so how do you pass-in arguments in a callback in an Angular component? In your Angular component you have to bind your callback with ‘&’ and return an object with the passed-in name as key: Angular-component.html <my-component callback=”$ctrl.callback(keyName)”></my-component> Angular-template.html <button ng-click=”${‘foo’:’bar’})”>Pass object to callback</button> Angular-component-and-controller.js […]

Read More