Skip to content

Commit 1b10d9c

Browse files
authored
rr/view/home (#7)
* rr/main-controller (pull request #2) rr/main-controller * fix gulp indexHTML task * removing unecessary elements * main-controller base Approved-by: Roberto Robson Soares Nogueira <[email protected]> * Merged in rr/navigation-bar (pull request #3) rr/navigation-bar * navigation-bar directive * add navigation-bar app.js dependency. set tiny md override md-button-icon Approved-by: Roberto Robson Soares Nogueira <[email protected]> * rr/side-menu (pull request #4) rr/side-menu Approved-by: Roberto Robson Soares Nogueira <[email protected]> * rr/ng-route (pull request #5) rr/ng-route * rr/fix/ng-view (pull request #6) rr/fix/ng-view Approved-by: Roberto Robson Soares Nogueira <[email protected]> * rr/view/home (pull request #7) rr/view/home Approved-by: Roberto Robson Soares Nogueira <[email protected]>
1 parent d015759 commit 1b10d9c

File tree

6 files changed

+135
-2
lines changed

6 files changed

+135
-2
lines changed

src/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
// directives
2121
'directives.mainController',
2222
'directives.navigation-bar',
23-
'directives.side-menu'
23+
'directives.side-menu',
2424

2525
// views
26-
// 'views.home'
26+
'views.home'
2727

2828
])
2929

src/sass/helpers.scss

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
.no-padding {
3+
padding: 0;
4+
}
5+
6+
.no-margin {
7+
margin: 0;
8+
}

src/sass/md-custom/md-button.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
.md-custom-fat-button {
3+
padding: 20px 0;
4+
}

src/views/home/home.config.js

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
'use strict';
3+
4+
(function(){
5+
6+
// properties
7+
8+
var view = 'home';
9+
var controller = 'ViewHomeController';
10+
11+
var route = {
12+
templateUrl: view + '/' + view + '.html',
13+
controller: controller,
14+
};
15+
16+
var configPath = {
17+
path: '/home/',
18+
label: 'Home',
19+
icon: 'home.svg',
20+
sideMenu: true
21+
};
22+
23+
// config
24+
25+
angular.module('views.' + view)
26+
27+
.config(function(
28+
$routeProvider,
29+
$locationProvider,
30+
pathProvider
31+
){
32+
33+
var pathObj = pathProvider.addPath(
34+
view,
35+
configPath
36+
);
37+
38+
var path = pathObj.path;
39+
40+
$routeProvider
41+
42+
.when(
43+
path,
44+
route
45+
)
46+
47+
.otherwise({
48+
redirectTo: path
49+
})
50+
51+
;
52+
53+
});
54+
55+
})();

src/views/home/home.html

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
<div
3+
layout-column
4+
layout-padding
5+
>
6+
<h1 class="md-display-3">
7+
Welcome to UI-Challenge
8+
</h1>
9+
<h2 class="md-display-1">
10+
Part 1
11+
</h2>
12+
13+
<div
14+
layout-column
15+
>
16+
<p class="md-headline">
17+
This project will provide you two features:
18+
</p>
19+
<ul
20+
layout-xs="column"
21+
layout-sm="column"
22+
layout-gt-sm="row"
23+
layout-margin
24+
layout-padding
25+
class="no-padding no-margin"
26+
>
27+
<li flex class="md-subhead" md-whiteframe="4">
28+
You can see your current location on the map;
29+
</li>
30+
<li flex class="md-subhead" md-whiteframe="4">
31+
You can find a website location and display it on the map;
32+
</li>
33+
</ul>
34+
<div
35+
layout="column"
36+
>
37+
<md-button
38+
class="md-raised md-primary md-custom-fat-button"
39+
ng-click="mainController.go('location')"
40+
>
41+
Let's try it!
42+
</md-button>
43+
</div>
44+
</div>
45+
46+
</div>

src/views/home/home.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
'use strict';
3+
4+
(function(){
5+
6+
angular.module('views.home',[])
7+
8+
.controller(
9+
'ViewHomeController',
10+
11+
function(
12+
path
13+
){
14+
15+
path.setCurrent('home');
16+
17+
}
18+
);
19+
20+
})();

0 commit comments

Comments
 (0)