mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
Added basic toderp
This commit is contained in:
0
example/toderp/app.css
Normal file
0
example/toderp/app.css
Normal file
43
example/toderp/app.js
Normal file
43
example/toderp/app.js
Normal file
@ -0,0 +1,43 @@
|
||||
angular.module('toderp', [])
|
||||
|
||||
.factory('TaskListService', function() {
|
||||
return {
|
||||
tasks: [
|
||||
{ text: 'Do this thing', created: new Date() }
|
||||
],
|
||||
todaysTasks: [
|
||||
{ text: 'Do this thing', created: new Date() }
|
||||
],
|
||||
addTask: function(task) {
|
||||
this.tasks.push(task);
|
||||
},
|
||||
deleteTask: function($index) {
|
||||
this.tasks.splice($index, 1);
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
.controller('TodaysTaskListCtrl', ['$scope', 'TaskListService', function($scope, TaskListService) {
|
||||
$scope.todaysTasks = TaskListService.todaysTasks;
|
||||
}])
|
||||
|
||||
.controller('TaskListCtrl', ['$scope', 'TaskListService', function($scope, TaskListService) {
|
||||
$scope.tasks = TaskListService.tasks;
|
||||
}])
|
||||
|
||||
.controller('TasksCtrl', ['$scope', function($scope) {
|
||||
|
||||
}]);
|
||||
|
||||
var page = document.getElementById('page');
|
||||
var leftPanel = document.getElementById('tasks-menu');
|
||||
var controller = new ion.controllers.LeftRightMenuViewController({
|
||||
isRightEnabled: false,
|
||||
center: page,
|
||||
left: leftPanel,
|
||||
leftWidth: 270,
|
||||
animateClass: 'menu-animated'
|
||||
});
|
||||
window.ion.onGesture('tap', function(e) {
|
||||
controller.toggleLeft();
|
||||
}, document.getElementById('menu-button'));
|
||||
56
example/toderp/index.html
Normal file
56
example/toderp/index.html
Normal file
@ -0,0 +1,56 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ToDerp</title>
|
||||
|
||||
<!-- Sets initial viewport load and disables zooming -->
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link href="/vendor/font-awesome/css/font-awesome.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../../dist/ionic.css">
|
||||
<link rel="stylesheet" href="app.css">
|
||||
|
||||
<script src="/vendor/angular/1.2.0rc1/angular-1.2.0rc1.min.js"></script>
|
||||
<script src="/vendor/angular/1.2.0rc1/angular-touch.js"></script>
|
||||
<script src="../../js/ionic-list.js"></script>
|
||||
<script src="../../js/ionic-events.js"></script>
|
||||
<script src="../../js/ionic-gestures.js"></script>
|
||||
<script src="../../js/controllers/ionic-leftrightmenu.js"></script>
|
||||
|
||||
</head>
|
||||
<body ng-app="toderp">
|
||||
<div id="page" class="page">
|
||||
<div class="bar bar-header bar-dark">
|
||||
<div class="buttons">
|
||||
<a id="menu-button" class="button button-dark" href="#">
|
||||
<i class="icon-reorder"></i>
|
||||
</a>
|
||||
</div>
|
||||
<h1 class="title">Today's Tasks</h1>
|
||||
<div class="buttons">
|
||||
<button id="right-button" class="button button-dark">
|
||||
<i class="icon-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content has-header">
|
||||
<ul class="list todays-tasks" ng-controller="TodaysTaskListCtrl">
|
||||
<li class="list-item" ng-repeat="task in todaysTasks">
|
||||
{{task.text}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tasks-menu" class="menu menu-left" ng-controller="TaskListCtrl">
|
||||
<ul class="list">
|
||||
<li class="list-divider">Tasks</li>
|
||||
<li class="list-item" ng-repeat="task in tasks">
|
||||
<a href="#">{{task.text}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="menu menu-right">
|
||||
</div>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user