4 ms·
That shouldn't even be a Promise imo. That should be an expression on your directive that is called with the selection. `on-select=handleSelection( selectedIt
by dcherman 11y ago
That shouldn't even be a Promise imo. That should be an expression on your directive that is called with the selection.
`on-select=handleSelection( selectedItem )` or something.
- robinson7d 11y agoI also don't think a promise makes much sense, if we're talking about the same sort of widget. For a "selector", where the whole purpose is selecting a thing, I think that even better than that would be to use ng-model (or something similar). Which nearly comes back full circle to the original $emitting an event scenario, except instead the other side would $watch (rather than $on, and avoiding the emit/broadcast part on the directive's side totally).