<toggle onstyle="{{'btn-success'}}" ng-model="$ctrl.myValue"></toggle>
triggers a $compile:nodomevents error.
while
<toggle offstyle="{{'btn-default'}}" ng-model="$ctrl.myValue"></toggle>
works without any issue.
This is because AngularJS prevents setting on* attributes (like onload, onclick, etc.) with an AngularJS expression.
Using x-onstyle or data-onstyle doesn't change the behavior.
The only fix to this would be to change the name of this attribute, like style-on. Any other idea?
PS: Behavior seen with AngularJS 1.7.2