angular-selection-model
angular-selection-model copied to clipboard
Add service for managing collection selections
I.e. to manage selections without relying on the directive.
selectionModelMgr.select(myCollection, myItemInCollection, opts, true);
// or maybe
model = selectionModelFactory(myCollection, opts);
model.select(item1);
model.selectAll([item1, item2]);
model.selectRange(item1, item2);
Before I head down a similar path, have you made any progress on this @jtrussell?
I haven't put down any code for this and I'd welcome a contribution. Did you have any thoughts on how the interface should be structured? I've got the selection manager on angular-ivh-treeview as prior art but I'm not super concerned with following the same pattern.
My goal is to have a clean way to deselect items before I remove them from the input list (used in the ng-repeat). I'd personally just follow the angular-ivh-treeview approach to get'r done quick, and hopefully learn how you're testing things.
2015-02-11 20:10 GMT-05:00 Justin Russell [email protected]:
I haven't put down any code for this and I'd welcome a contribution. Did you have any thoughts on how the interface should be structured? I've got the selection manager on angular-ivh-treeview https://github.com/ivantage/angular-ivh-treeview#treeview-manager-service as prior art but I'm not super concerned with following the same pattern.
Reply to this email directly or view it on GitHub https://github.com/jtrussell/angular-selection-model/issues/26#issuecomment-73999373 .
At the risk of over engineering everything I'm leaning towards tossing this service in a separate repo/module, I might eventually carve out the selectionModelOptions service into its own module as well so folks could pick and choose which pieces they need (or even replace pieces) and those settings are what will drive behavior of everything else. Thoughts?
I started a skeleton over here but I'm not 100% committed to this approach.