{"id":738,"date":"2018-02-25T20:33:16","date_gmt":"2018-02-25T12:33:16","guid":{"rendered":"http:\/\/60.205.208.74\/2018\/02\/25\/ionic-%e5%a4%8d%e9%80%89%e6%a1%86\/"},"modified":"2018-02-25T20:33:16","modified_gmt":"2018-02-25T12:33:16","slug":"ionic-%e5%a4%8d%e9%80%89%e6%a1%86","status":"publish","type":"post","link":"https:\/\/www.puzi7.net\/?p=738","title":{"rendered":"ionic \u590d\u9009\u6846"},"content":{"rendered":"<span itemprop=\"description\"><div class=\"article-body\">\n<div class=\"article-intro\" id=\"content\">\n<h1>ionic \u590d\u9009\u6846<\/h1>\n<p>ionic \u590d\u9009\u6846\uff08checkbox\uff09\u4e0e\u666e\u901a\u7684 HTML \u590d\u9009\u6846\u6ca1\u4ec0\u4e48\u533a\u522b\uff0c\u4ee5\u4e0b\u5b9e\u4f8b\u6f14\u793a\u4e86 ionic \u590d\u9009\u6846 ion-checkbox \u7684\u5e94\u7528\u3002<\/p>\n<pre>\n&lt;ion-checkbox ng-model=\"isChecked\"&gt;\u590d\u9009\u6846\u6807\u7b7e&lt;\/ion-checkbox&gt;\n<\/pre>\n<hr>\n<h2>\u5b9e\u4f8b<\/h2>\n<p>\u5b9e\u4f8b\u4e2d\uff0c\u4f1a\u6839\u636e\u590d\u9009\u6846\u662f\u5426\u9009\u4e2d\uff0c\u4fee\u6539 checked \u503c\uff0ctrue \u4e3a\u9009\u4e2d\uff0c false \u4e3a\u672a\u9009\u4e2d\u3002<\/p>\n<h3>HTML \u4ee3\u7801<\/h3>\n<pre>\n&lt;ion-header-bar class=\"bar-positive\"&gt;\n  &lt;h1 class=\"title\"&gt;\u590d\u9009\u6846&lt;\/h1&gt;\n&lt;\/ion-header-bar&gt;\n         \n&lt;ion-content&gt;\n  \n  &lt;div class=\"list\"&gt;\n    \n    &lt;ion-checkbox ng-repeat=\"item in devList\"\n                  ng-model=\"item.checked\" \n                  ng-checked=\"item.checked\"&gt;\n      {{ item.text }}\n    &lt;\/ion-checkbox&gt;\n    \n    &lt;div class=\"item\"&gt;\n      &lt;div ng-bind=\"devList | json\"&gt;&lt;\/div&gt; \n    &lt;\/div&gt;\n    \n    &lt;div class=\"item item-divider\"&gt; \n      Notifications\n    &lt;\/div&gt;\n    \n    &lt;ion-checkbox ng-model=\"pushNotification.checked\"\n                  ng-change=\"pushNotificationChange()\"&gt;\n      Push Notifications\n    &lt;\/ion-checkbox&gt;\n    \n    &lt;div class=\"item\"&gt;\n      &lt;div ng-bind=\"pushNotification | json\"&gt;&lt;\/div&gt; \n    &lt;\/div&gt;\n    \n    &lt;ion-checkbox ng-model=\"emailNotification\"\n                  ng-true-value=\"'Subscribed'\"\n                  ng-false-value=\"'Unubscribed'\"&gt;\n      Newsletter\n    &lt;\/ion-checkbox&gt;\n    &lt;div class=\"item\"&gt;\n      &lt;div ng-bind=\"emailNotification | json\"&gt;&lt;\/div&gt; \n    &lt;\/div&gt;\n    \n  &lt;\/div&gt;\n  \n&lt;\/ion-content&gt;\n<\/pre>\n<h3>JavaScript \u4ee3\u7801<\/h3>\n<pre>\nangular.module('starter', ['ionic'])\n\n.run(function($ionicPlatform) {\n$ionicPlatform.ready(function() {\n  \/\/ Hide the accessory bar by default (remove this to show the accessory bar above the keyboard\n  \/\/ for form inputs)\n  if(window.cordova &amp;&amp; window.cordova.plugins.Keyboard) {\n    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);\n  }\n  if(window.StatusBar) {\n    StatusBar.styleDefault();\n  }\n});\n})\n\n.controller( 'actionsheetCtl',['$scope',function($scope){\n\n  $scope.devList = [\n      { text: \"HTML5\", checked: true },\n      { text: \"CSS3\", checked: false },\n      { text: \"JavaScript\", checked: false }\n    ];\n\n    $scope.pushNotificationChange = function() {\n      console.log('Push Notification Change', $scope.pushNotification.checked);\n    };\n\n    $scope.pushNotification = { checked: true };\n    $scope.emailNotification = 'Subscribed';\n\n}])\n<\/pre>\n<p>css \u4ee3\u7801\uff1a<\/p>\n<pre>\nbody {\n  cursor: url('http:\/\/www.runoob.com\/try\/demo_source\/finger.png'), auto;\n}\n<\/pre>\n<p><a href=\"\/try\/tryit.php?filename=ionic_ion-checkbox\" target=\"_blank\"><button class=\"btn example-btn\">\u5c1d\u8bd5\u4e00\u4e0b \u00bb<\/button><\/a><\/p>\n<p>\u6548\u679c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p><iframe frameborder=\"0\" height=\"400\" src=\"\/try\/demo_source\/ionic_ion-checkbox.htm\"><\/iframe>\t\t\t<\/p><\/div>\n<\/p><\/div>\n<span>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\"><span itemprop=\"description\">ionic \u590d\u9009\u6846 ionic \u590d\u9009\u6846\uff08checkbox\uff09\u4e0e\u666e\u901a\u7684 HTML \u590d\u9009\u6846\u6ca1\u4ec0\u4e48&hellip;<\/span><\/p>\n<p class=\"more-link-p btn-align-right\"><a class=\"green zoom-btn\" href=\"https:\/\/www.puzi7.net\/?p=738\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,26],"tags":[43,72,73,93],"class_list":["post-738","post","type-post","status-publish","format-standard","hentry","category-hybrid","category-mobile","tag-angular","tag-hybrid","tag-ionic","tag-mobile","zoom-theme-has-thumb"],"_links":{"self":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=738"}],"version-history":[{"count":0,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/738\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}