微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ionic之创建列表

1、实例背景

ionic创建动态列表,根据AngularJS赋值


2、实现源码

<!DOCTYPE html>
<html>
	<head>
		<Meta charset="UTF-8">
		<Meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<title>ionic之创建列表</title>
		<link rel="stylesheet" href="../css/ionic.css" />
		<script type="text/javascript" src="../js/ionic.bundle.js" ></script>
		<script>
			var app = angular.module("initApp",["ionic"]);
			app.controller("initController",function($scope){
				$scope.users = [
					{username:'赵思思'},{username:'梨花胡'},{username:'孙丽丽'},{username:'胡思思'},{username:'孙磊'}
				];
			});
		</script>
		<title></title>
	</head>
	<body ng-app="initApp" ng-controller="initController">
		<ion-side-menus>
			<ion-side-menu-content>
				<ion-header-bar class="bar-dark">
					<span class="title">查询</span>
				</ion-header-bar>
				<ion-content>
					<ion-list>
						<ion-item ng-repeat="user in users">
							{{user.username}}
						</ion-item>
					</ion-list>
				</ion-content>
			</ion-side-menu-content>
			
			<ion-side-menu side="left">
				<ion-header-bar class="bar-dark">
					<label class="title">修改</label>
				</ion-header-bar>
				<ion-content>
					<ion-list>
						<ion-item ng-repeat="user in users">
							{{user.username}}
						</ion-item>
					</ion-list>
				</ion-content>
			</ion-side-menu>
		</ion-side-menus>
	</body>
</html>

3、实现结果

(1)初始化


(2)移动菜单

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐