-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
65 lines (54 loc) · 2.04 KB
/
index.html
File metadata and controls
65 lines (54 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html ng-app="demoApp">
<head>
<title>Lesson</title>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body ng-controller="demoController">
<div class="well">
<p>
Welcome!
</p>
</div>
<div class="container">
<div ng-container class="row">
<div ng-repeat="project in projects | filter:filterText | orderBy:sort">
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="panel panel-default" ng-click="navigate(project.url)">
<div class="panel-heading">{{ project.name }}</div>
<div class="panel-body">{{ project.description }}</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js"></script>
<script>
var app = angular.module('demoApp', []);
app.controller('demoController', function ($scope, $window, $location) {
$scope.projects = [{
'name': 'Web Application Tutorial',
'description': "Lessons on how to use Angular and Bootstrap to create modern, responsive, web applications that can be transformed into great mobiles apps.",
'url': "http://johnshew.github.io/WebAppTutorial/Lessons/index.html"
}];
// sort, sortField, sortAscending, sortButtonClick(field)
$scope.$watch('sortField', function () {
$scope.sortAscending = true;
});
$scope.$watch('sortField+sortAscending', function () {
$scope.sort = (($scope.sortAscending) ? "+" : "-") + $scope.sortField;
});
$scope.sortField = "name";
$scope.sortButtonClick = function (field) {
$scope.sortField = field;
$scope.sortAscending = !$scope.sortAscending;
};
$scope.navigate = function (url) {
$window.location.href = url;
}
});
</script>
</body>
</html>