cgarvis / angular-toggle-switch

AngularJS Toggle Switch
http://cgarvis.github.io/angular-toggle-switch
MIT License
160 stars 124 forks source link

Implemented callback on toggle event w/test #32

Closed paul-tST closed 10 years ago

cgarvis commented 10 years ago

Could your go be accomplish if we didn't use ng-click inside the directive, so you could use it with it?

<toggle-switch ng-model="isToggled" ng-click="callback()" />

33 got me thinking about this. I would prefer to keep the directive as simple as possible and interlope with other directives. What do you think?

cgarvis commented 10 years ago

Do you want to try implementing this? I believe you can use element.bind on click.

paul-barry-cengage commented 10 years ago

Yes, removing the ng-click from the directive template and applying it using .on('click', scope.toggle) worked within the link function. I didn't take the time to test, but the base functionality works great.

paul-barry-cengage commented 10 years ago

Hi Chris, Any word on this merge?

Thanks.

ssmereka commented 10 years ago

+1 Would like to see this tested and merged.

CMaylone commented 10 years ago

+1 on the wanting to see this merged.

cgarvis commented 10 years ago

@paul-tST thanks!