I'm a very beginner at Ionic, and while reading documentation on http://ionicframework.com/docs, I noticed that for every piece of layout there are two options: CSS or JavaScript.
For example, to make a toggle button I can use CSS option:
<label class="toggle">
<input type="checkbox">
<div class="track">
<div class="handle"></div>
</div>
</label>
... or JS option:
<ion-toggle ng-model="airplaneMode" toggle-class="toggle-calm">Airplane Mode</ion-toggle>
I wondering, why there are two options for, apparently, the same? Could someone please explain which option is more suitable for which scenario?
Thanks
The CSS option is agnostic and allows another framework to handle the functionality, whereas the provided JS option uses Angular since it is bundled with the Ionic framework.
Whichever you use ultimately depends on how involved you want Ionic/Angular to be in your app's logic.