ksachdeva / angular-swiper

Angular directive for nolimits4web/Swiper
Apache License 2.0
197 stars 94 forks source link

bi-directional binding fails #7

Open nurfgun opened 9 years ago

nurfgun commented 9 years ago

passing an object scope variable to the 'swiper' attribute doesn't work. It seems that updating parent scope's variable by setting it to an object in a child scope does not seem to change the parent scope, but rather creates a new variable on the child scope and pass the object to it.

I've looked at the source and modified the related part like this:

swiper = new Swiper($element[0].firstChild, params);
for (var attr in swiper){$scope.swiper[attr] = swiper[attr]}

I see that you are very active on this repo and am sure you would spot this in no time or may have already fixed this while I was figuring out using your old version of code. In any case, hope this thread contributes a bit.