angular-selection-model icon indicating copy to clipboard operation
angular-selection-model copied to clipboard

Add service for managing collection selections

Open jtrussell opened this issue 11 years ago • 4 comments

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);

jtrussell avatar Oct 21 '14 01:10 jtrussell

Before I head down a similar path, have you made any progress on this @jtrussell?

seanpoulter avatar Feb 11 '15 22:02 seanpoulter

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.

jtrussell avatar Feb 12 '15 01:02 jtrussell

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 .

seanpoulter avatar Feb 13 '15 22:02 seanpoulter

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.

jtrussell avatar Feb 15 '15 16:02 jtrussell