YouTip LogoYouTip

Ionic Ion Toggle

# Ionic Toggle Switch In the following example, toggling different switches displays different values. `true` indicates ON, and `false` indicates OFF. ### HTML Code

Toggle Switch

Settings
{{ item.text }}
Notifications
Push Notifications
Newsletter
Due to conflicts with the `
` tag, the `
` tags in the example have been replaced with `
` tags. You can view the actual implementation by clicking "Try it yourself". ### JavaScript Code angular.module('ionicApp', ['ionic']).controller('MainCtrl', function($scope) { $scope.settingsList = [ { text: "Wireless", checked: true }, { text: "GPS", checked: false }, { text: "Bluetooth", checked: false } ]; $scope.pushNotificationChange = function() { console.log('Push Notification Change', $scope.pushNotification.checked); }; $scope.pushNotification = { checked: true }; $scope.emailNotification = 'Subscribed'; }); CSS Code: body { cursor: url(''), auto;} [Try it yourself Β»](#) The result will appear as follows:
← Ionic Gesture EventLinux Comm Dmesg β†’