我在我的應用程序中使用angular和bootstrap-switch插件。它的工作原理是這樣的:自舉開關和ng模型
<input type="checkbox" name="my-checkbox" checked>
<script>$("[name='my-checkbox']").bootstrapSwitch("size", "small");</script>
的問題是,如果我想使用所有我發現there屬性這是行不通的。
如何在我的交換機上使用ng-model? 我想用這樣的:
<input type="checkbox" name="my-checkbox" checked="variableStatus" data-on-color="success" data-off-color="warning">
or
<input type="checkbox" name="my-checkbox" ng-model="variableStatus" data-on-color="success" data-off-color="warning">