IONIC----01.ionicActionSheet
2016-07-08 11:35
330 查看
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width,height=device-height"> <script src="./lib/js/ionic.bundle.min.js"></script> <link rel="stylesheet" type="text/css" href="./lib/css/ionic.min.css"> <title>Ionic</title> </head> <body ng-app="myApp" ng-controller="fristController"> <ion-header-bar class="bar-positive"> <h1 class="title">$ionicActionSheet</h1> <a class="button" ng-click="show();">操作</a> </ion-header-bar> <ion-content padding="true"> AAA<br>BBB<br>CCC </ion-content> </body> </html> <script> angular.module("myApp", ["ionic"]) .controller("fristController",function($scope, $ionicActionSheet, $timeout) { // Triggered on a button click, or some other target $scope.show = function() { // Show the action sheet var hideSheet= $ionicActionSheet.show({ cancelOnStateChange:true, cssClass:'action_s', titleText: "操作当前文章", buttons: [ { text: "<b>分享</b>文章" }, { text: "移动到..." } ], buttonClicked: function(index) { console.log('操作了第'+index+'个文章'); return true; }, cancelText: "取消", cancel: function() { // add cancel code.. console.log('执行了取消操作'); return true; }, destructiveText: "删除", destructiveButtonClicked:function(){ console.log('执行了删除操作'); return true; } }); // For example's sake, hide the sheet after two seconds $timeout(function() { hideSheet(); }, 2000); }; }); </script>
GitHub
相关文章推荐
- ionic 上拉菜单(ActionSheet)实例代码
- Ionic实现页面下拉刷新(ion-refresher)功能代码
- Select data from an Excel sheet in MSSQL
- Default style sheet for HTML 4
- Ionic快速安装教程
- Ionic如何创建APP项目
- ionic js 复选框 与普通的 HTML 复选框到底有没区别
- Ionic如何实现下拉刷新与上拉加载功能
- Ionic实现仿通讯录点击滑动及$ionicscrolldelegate使用分析
- Ionic框架入门(原文翻译)
- Ionic学习笔记
- Ionic如何实现下拉刷新与上拉加载功能
- Ionic快速安装教程
- Ionic如何创建APP项目
- Ionic实现页面下拉刷新(ion-refresher)功能代码
- 程序员小抄大全
- Ionic常用命令行解释
- ionic添加admob广告教程
- ionic 的 下拉刷新 与 上拉加载