Home >Web Front-end >JS Tutorial >Create a list in ionic

Create a list in ionic

黄舟
黄舟Original
2017-02-17 14:10:071290browse

1. Example background

ionic creates a dynamic list and assigns values ​​​​according to AngularJS


2. Implementation source code

<!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:&#39;赵思思&#39;},
					{username:&#39;梨花胡&#39;},
					{username:&#39;孙丽丽&#39;},
					{username:&#39;胡思思&#39;},
					{username:&#39;孙磊&#39;}
				];
			});
		</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. Implementation result


(1) Initialization

Create a list in ionic


##(2) Mobile menu

Create a list in ionic

# # The above is the content of ionic's creation list. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:ionic style bar-lightNext article:ionic style bar-light