Skip to content

Commit 42265d3

Browse files
committed
Login form using Angular Material - #202
1 parent bf549a8 commit 42265d3

File tree

7 files changed

+62
-4
lines changed

7 files changed

+62
-4
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div>
2+
<md-input-container class="LoginForm-inputContainer">
3+
<label>Email</label>
4+
<input type="email" ng-model="vm.email">
5+
</md-input-container>
6+
</div>
7+
8+
<div>
9+
<md-input-container class="LoginForm-inputContainer">
10+
<label>Password</label>
11+
<input type="password" ng-model="vm.password">
12+
</md-input-container>
13+
</div>
14+
15+
<md-button type="submit" class="LoginForm-submit md-primary md-raised">Login</md-button>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class LoginFormController{
2+
constructor(){
3+
'ngInject';
4+
5+
this.email = '';
6+
this.password = '';
7+
}
8+
}
9+
10+
export const LoginFormComponent = {
11+
templateUrl: './views/app/components/login-form/login-form.component.html',
12+
controller: LoginFormController,
13+
controllerAs: 'vm',
14+
bindings: {}
15+
}
16+
17+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.LoginForm-inputContainer{
2+
margin-top: 10px;
3+
margin-bottom: 0px;
4+
margin-left: 8px;
5+
width: 80%;
6+
}
7+
8+
.LoginForm-submit{
9+
margin-bottom: 40px;
10+
}

angular/app/pages/login/login.less

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<md-content class="Page-container">
2+
<div flex="80" flex-offset="10">
3+
<h1>Login</h1>
4+
5+
<login-form></login-form>
6+
</div>
7+
</md-content>

angular/config/RoutesConfig.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ export function RoutesConfig($stateProvider, $urlRouterProvider) {
2121
}
2222
})
2323
.state('app.landing', {
24-
url: '/',
24+
url: '/',
25+
data: {},
26+
views: {
27+
'main@': {
28+
templateUrl: getView('landing')
29+
}
30+
}
31+
})
32+
.state('app.login', {
33+
url: '/login',
2534
data: {},
2635
views: {
2736
'main@': {
28-
templateUrl: getView('landing')
37+
templateUrl: getView('login')
2938
}
3039
}
3140
});

angular/index.components.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
//import {YourComponent} from './app/components/your/your.component';
1+
import {LoginFormComponent} from './app/components/login-form/login-form.component';
22

3-
//angular.module('app.components').component('yourComponent', YourComponent);
3+
angular.module('app.components').component('loginForm', LoginFormComponent);

0 commit comments

Comments
 (0)