-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.html
61 lines (57 loc) · 2.33 KB
/
example.html
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
<!DOCTYPE html>
<html>
<head>
<script src="https://code.angularjs.org/1.4.7/angular.js"></script>
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="dist/ng-bootstrap-submenu.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<link rel="stylesheet" href="dist/ng-bootstrap-submenu.min.css" />
</head>
<body ng-app="myApp">
<div ng-controller="menuController">
<nav class="navbar navbar-default">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand">ng-bootstrap-submenu</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<bootstrap-submenu ng-repeat="item in menuItems" menu-item="item">
</bootstrap-submenu>
</ul>
</div>
</nav>
</div>
<script>
(function(){
angular.module('myApp', ['bootstrapSubmenu']);
angular.module('myApp')
.controller('menuController', function($scope){
$scope.menuItems = [
{ display: 'Dropdown Item 1', href: '#', children: [
{ display: 'Child 1', href: '#', children: [
{ display: 'Sub 1', href: 'http://www.google.com', children: []},
{ display: 'Sub 2', href: '#', children: [
{ display: 'Grand Child 1', href: 'http://www.google.com', children: []},
{ display: 'Grand Child 2', href: 'http://www.google.com', children: []}
]}
]},
{ display: 'Child 2', href: 'http://www.google.com', children: []}
]},
{ display: 'Dropdown Item 2', href: 'http://www.google.com', children: []},
{ display: 'Dropdown Item 3', href: '#', children: [
{ display: 'Child 3', href: 'http://www.google.com', children: []}
]}
];
});
})();
</script>
</body>
</html>