首页
极刻
圈子
教程
开源
登录 / 注册
返回教程:ionic 教程
TRY RUN / 在线示例
ionic 教程 尝试一下
ionic 教程 尝试一下
源代码
运行
<html ng-app="ionicApp"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title>安科教程(www.ancii.com)</title> <link href="https://img.s.ancii.com/tutorial/archive/statics/demosource/ionic.min.css" rel="stylesheet"> <script src="https://img.s.ancii.com/tutorial/archive/statics/demosource/ionic.bundle.min.js"></script> <script> angular.module('ionicApp', ['ionic']) .controller('AppCtrl', function($scope, $timeout, $ionicLoading) { // Setup the loader $ionicLoading.show({ content: 'Loading', animation: 'fade-in', showBackdrop: true, maxWidth: 200, showDelay: 0 }); // Set a timeout to clear loader, however you would actually call the $ionicLoading.hide(); method whenever everything is ready or loaded. $timeout(function () { $ionicLoading.hide(); $scope.stooges = [{name: 'Moe'}, {name: 'Larry'}, {name: 'Curly'}]; }, 2000); }); </script> </head> <body ng-controller="AppCtrl"> <ion-view title="Home"> <ion-header-bar> <h1 class="title">The Stooges</h1> </ion-header-bar> <ion-content has-header="true"> <ion-list> <ion-item ng-repeat="stooge in stooges" href="#">{{stooge.name}}</ion-item> </ion-list> </ion-content> </ion-view> </body> </html>
运行结果