Skip to content

Commit 85d5bc5

Browse files
committed
Initial commit-REST API Display'
1 parent fb2b683 commit 85d5bc5

17 files changed

+598
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
body {
2+
font-size: 1.2em;
3+
}
4+
5+
.error {
6+
color: red;
7+
font-weight: bold;
8+
display: none;
9+
}
10+
11+
.loading-icon {
12+
position: absolute;
13+
left: 50%;
14+
top: 10px;
15+
}
16+
17+
.active {
18+
font-weight: bold;
19+
}
20+
21+
li[ui-sref]:hover {
22+
display: inline-block;
23+
cursor: pointer;
24+
border: solid black 1px;
25+
padding-left: 5px;
26+
padding-right: 5px;
27+
}
27.5 KB
Loading

master-detail-view-pair/index.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<html ng-app='MenuApp'>
3+
<head>
4+
<meta charset="utf-8">
5+
<link rel="stylesheet" href="css/styles.css">
6+
<title>Welcome to our Restaurant</title>
7+
</head>
8+
<body>
9+
<h1>Welcome to our Restaurant</h1>
10+
11+
<ui-view></ui-view>
12+
<loading-spinner></loading-spinner>
13+
14+
<!-- Libraries -->
15+
<script src="lib/angular.min.js"></script>
16+
<script src="lib/angular-ui-router.min.js"></script>
17+
18+
<!-- Modules -->
19+
<script src="src/shoppinglist/menuapp.module.js"></script>
20+
<script src="src/shoppinglist/data.module.js"></script>
21+
22+
23+
<!-- Routes -->
24+
<script src="src/routes.js"></script>
25+
<script src="src/spinner/spinner.module.js"></script>
26+
27+
28+
<!-- 'ShoppingList' module artifacts -->
29+
<script src="src/shoppinglist/categories.component.js"></script>
30+
<script src="src/shoppinglist/main-shoppinglist.controller.js"></script>
31+
<script src="src/shoppinglist/menudata.service.js"></script>
32+
33+
34+
35+
<!-- 'Spinner' module artifacts -->
36+
<script src="src/spinner/loadingspinner.component.js"></script>
37+
38+
</body>
39+
</html>

master-detail-view-pair/lib/angular-ui-router.min.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

master-detail-view-pair/lib/angular.min.js

Lines changed: 332 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
(function () {
2+
'use strict';
3+
4+
angular.module('MenuApp')
5+
.config(RoutesConfig);
6+
7+
RoutesConfig.$inject = ['$stateProvider', '$urlRouterProvider'];
8+
function RoutesConfig($stateProvider, $urlRouterProvider) {
9+
10+
11+
$urlRouterProvider.otherwise('/');
12+
13+
14+
$stateProvider
15+
16+
17+
.state('home', {
18+
url: '/',
19+
templateUrl: 'src/shoppinglist/templates/home.template.html'
20+
})
21+
22+
23+
.state('categories', {
24+
url: '/categories',
25+
templateUrl: 'src/shoppinglist/templates/main-shoppinglist.template.html',
26+
controller: 'MainShoppingListController as categories',
27+
resolve: {
28+
items: ['MenuDataService ', function (MenuDataService) {
29+
return MenuDataService .getAllCategories().then(function(response) {
30+
return response.data;
31+
});
32+
}]
33+
}
34+
});
35+
36+
37+
}
38+
39+
})();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(function () {
2+
'use strict';
3+
4+
angular.module('MenuApp')
5+
.component('categories', {
6+
templateUrl: 'src/shoppinglist/templates/categories.component.template.html',
7+
bindings: {
8+
items: '<'
9+
}
10+
});
11+
12+
})();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(function () {
2+
'use strict';
3+
4+
angular.module('Data', []);
5+
6+
})();
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(function () {
2+
'use strict';
3+
4+
angular.module('MenuApp')
5+
.controller('MainShoppingListController', MainShoppingListController);
6+
7+
8+
MainShoppingListController.$inject = ['items'];
9+
function MainShoppingListController(items) {
10+
var categories = this;
11+
categories.items = items;
12+
13+
14+
}
15+
16+
})();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(function () {
2+
'use strict';
3+
4+
angular.module('MenuApp', ['ui.router','Spinner','Data']);
5+
6+
})();

0 commit comments

Comments
 (0)