so this is how it looks like, and here is the Plunker
parent scope
ng-repeat
directive
in the directive there is an attribute is bi-directional binding with a variable in parent scope.
But this doesn't work as I wanted.(But I can understand why it doesn't work)
The reason is ngRepeat will create it's own scope, so once the variable is changed in directive, Angular add a variable in ngRepeat, but it leave the variable in parent unchanged.
I can do something like scope.$parent.$parent.variable to change the variable, but it is kinda not the idea in Angular.
How should I do ?
Moreover, if I change the repeated item in the items collection, the item can't be changed.
Because of the same reason above.