vitalets / checklist-model

AngularJS directive for list of checkboxes
http://vitalets.github.io/checklist-model
MIT License
1.05k stars 207 forks source link

there is a defect about checklist-before-change #127

Open e-cloud opened 8 years ago

e-cloud commented 8 years ago

Now, checklist-before-change's behavior is evaluate an expression which perform some judge based on data outside the directive scope.

But, there is a situation. before changing the model, i need to know what's the change going to be, so that i can compare the future and the current to see if let the future happen.

as the event system, no context is horrible.

Now that feature is unavailable.

beradrian commented 8 years ago

The first argument passed to checklist-before-change is the scope. What I can do is to also pass the context as this and also add oldValue and newValue as arguments. What do you think about it.

e-cloud commented 8 years ago

here and here is the code.

Actually the scope is used for the parser to evaluate the expression unexceptionally. That's not the argument passed to the function call binded to the directive.

For the design now, i think it's hard to achieve my goal. Sorry, for now, i can just state the issue but not solve it.

May be some general refactoring needed?