Ionic JS check box and normal HTML checkbox in the end there is no difference _javascript skills

Source: Internet
Author: User

Ionic check box

The Ionic check box (checkbox) is no different from a normal HTML check box, and the following example demonstrates the application of the Ionic checkbox Ion-checkbox.

<ion-checkbox ng-model= "ischecked" > check box label </ion-checkbox>

Instance

instance, the checked value is modified based on whether the check box is selected, True is checked, and false is unchecked.

HTML Code

 <ion-header-bar class= "bar-positive" > 

JavaScript Code

Angular.module (' starter ', [' Ionic '])
. Run (function ($ionicPlatform) {
$ionicPlatform. Ready (function () {
//Hide the accessory bar by default (remove the accessory bar above the keyboard
//For form inputs )
if (Window.cordova && window.cordova.plugins.Keyboard) {
Cordova.plugins.Keyboard.hideKeyboardAccessoryBar (true);
if (window. StatusBar) {
statusbar.styledefault ();}})
. Controller (' Actionsheetctl ', [' $scope ', function ($scope) {
$scope. devlist = [
{text: ' HTML5 ', checked:true} ,
{text: "CSS3", Checked:false},
{text: "JavaScript", 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 (' http://www.runoob.com/try/demo_source/finger.png '), auto;
}

The effect looks like this:


Complete Source:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.