aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch10-01-simple-routing.html
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch10-01-simple-routing.html')
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch10-01-simple-routing.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch10-01-simple-routing.html b/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch10-01-simple-routing.html
new file mode 100644
index 00000000..29614127
--- /dev/null
+++ b/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch10-01-simple-routing.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Simple Routing</title>
+ <script src="../../tp/angular.js"></script>
+ <script src="../../tp/angular-route.js"></script>
+</head>
+<body ng-app="routingApp">
+
+ <h2>Angular Routing</h2>
+
+ <ul>
+ <li><a href="#/">Default Route</a></li>
+ <li><a href="#/second">Second Route</a></li>
+ <li><a href="#/asdfertdfghsdfg">Non-existent Route</a></li>
+ </ul>
+
+ <div ng-view></div>
+
+ <script type="text/javascript">
+ angular.module('routingApp', ['ngRoute'])
+ .config(['$routeProvider', function ($routeProvider) {
+ $routeProvider
+ .when('/', {
+ template: '<h5>This is the default route</h5>'
+ })
+ .when('/second', {
+ template: '<h5>This is the second route</h5>'
+ })
+ .otherwise({
+ redirectTo: '/'
+ });
+ }]);
+ </script>
+</body>
+</html>