summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch08-04-custom-filters.html
diff options
context:
space:
mode:
authorCNlucius <lukai1@huawei.com>2016-09-13 11:40:12 +0800
committerCNlucius <lukai1@huawei.com>2016-09-13 11:41:53 +0800
commitb731e2f1dd0972409b136aebc7b463dd72c9cfad (patch)
tree5107d7d80c19ad8076c2c97c2b5ef8d1cf3ab903 /framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch08-04-custom-filters.html
parentee93993458266114c29271a481ef9ce7ce621b2a (diff)
ONOSFW-171
O/S-SFC-ONOS scenario documentation Change-Id: I51ae1cf736ea24ab6680f8edca1b2bf5dd598365 Signed-off-by: CNlucius <lukai1@huawei.com>
Diffstat (limited to 'framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch08-04-custom-filters.html')
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch08-04-custom-filters.html61
1 files changed, 0 insertions, 61 deletions
diff --git a/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch08-04-custom-filters.html b/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch08-04-custom-filters.html
deleted file mode 100644
index f39991d9..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch08-04-custom-filters.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Custom Filters in Action</title>
- <script src="../../tp/angular.js"></script>
-</head>
-<body ng-app="filtersApp">
-
- <div ng-controller="FilterCtrl as ctrl">
- <div>
- Start time (Timestamp): {{ctrl.startTime}}
- </div>
- <div>
- Start time (Time): {{ctrl.startTime | date:'h:m a'}}
- </div>
- <div>
- Start time (Our filter): {{ctrl.startTime | timeAgo}}
- </div>
- <div>
- Start time (Our filter 2): {{ctrl.startTime | timeAgo:true}}
- </div>
- <div>
- Some time ago (Computed): {{ctrl.someTimeAgo | date:'h:m a'}}
- </div>
- <div>
- Some time ago (Our filter): {{ctrl.someTimeAgo | timeAgo}}
- </div>
- </div>
-
- <script type="text/javascript">
- angular.module('filtersApp', [])
- .controller('FilterCtrl', [function () {
- var self = this;
- self.startTime = new Date().getTime();
- self.someTimeAgo = self.startTime - (1000*3600*4);
- }])
- .filter('timeAgo', [function () {
- var _m = 1000 * 60,
- _h = _m * 60,
- _d = _h * 24,
- _mon = _d * 30;
-
- return function (ts, ignoreSecs) {
- var now = new Date().getTime(),
- diff = now - ts;
- if (diff < _m && !ignoreSecs) {
- return 'seconds ago';
- } else if (diff < _h) {
- return 'minutes ago';
- } else if (diff < _d) {
- return 'hours ago';
- } else if (diff < _mon) {
- return 'days ago';
- } else {
- return 'months ago';
- }
- }
- }]);
- </script>
-</body>
-</html>