Skip to content

Commit

Permalink
Login form using Angular Material - #202
Browse files Browse the repository at this point in the history
  • Loading branch information
jadjoubran committed Mar 22, 2016
1 parent bf549a8 commit 42265d3
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 4 deletions.
15 changes: 15 additions & 0 deletions angular/app/components/login-form/login-form.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div>
<md-input-container class="LoginForm-inputContainer">
<label>Email</label>
<input type="email" ng-model="vm.email">
</md-input-container>
</div>

<div>
<md-input-container class="LoginForm-inputContainer">
<label>Password</label>
<input type="password" ng-model="vm.password">
</md-input-container>
</div>

<md-button type="submit" class="LoginForm-submit md-primary md-raised">Login</md-button>
17 changes: 17 additions & 0 deletions angular/app/components/login-form/login-form.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class LoginFormController{
constructor(){
'ngInject';

this.email = '';
this.password = '';
}
}

export const LoginFormComponent = {
templateUrl: './views/app/components/login-form/login-form.component.html',
controller: LoginFormController,
controllerAs: 'vm',
bindings: {}
}


10 changes: 10 additions & 0 deletions angular/app/components/login-form/login-form.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.LoginForm-inputContainer{
margin-top: 10px;
margin-bottom: 0px;
margin-left: 8px;
width: 80%;
}

.LoginForm-submit{
margin-bottom: 40px;
}
Empty file.
7 changes: 7 additions & 0 deletions angular/app/pages/login/login.page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<md-content class="Page-container">
<div flex="80" flex-offset="10">
<h1>Login</h1>

<login-form></login-form>
</div>
</md-content>
13 changes: 11 additions & 2 deletions angular/config/RoutesConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,20 @@ export function RoutesConfig($stateProvider, $urlRouterProvider) {
}
})
.state('app.landing', {
url: '/',
url: '/',
data: {},
views: {
'main@': {
templateUrl: getView('landing')
}
}
})
.state('app.login', {
url: '/login',
data: {},
views: {
'main@': {
templateUrl: getView('landing')
templateUrl: getView('login')
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions angular/index.components.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//import {YourComponent} from './app/components/your/your.component';
import {LoginFormComponent} from './app/components/login-form/login-form.component';

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

0 comments on commit 42265d3

Please sign in to comment.