-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Login functionality using satellizer #202
- Loading branch information
1 parent
39b0c35
commit 254a84f
Showing
8 changed files
with
50 additions
and
34 deletions.
There are no files selected for viewing
28 changes: 15 additions & 13 deletions
28
angular/app/components/login-form/login-form.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
<div> | ||
<md-input-container class="LoginForm-inputContainer"> | ||
<label>Email</label> | ||
<input type="email" ng-model="vm.email"> | ||
</md-input-container> | ||
</div> | ||
<form ng-submit="vm.login()"> | ||
<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> | ||
<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> | ||
<md-button type="submit" class="LoginForm-submit md-primary md-raised">Login</md-button> | ||
</form> |
36 changes: 24 additions & 12 deletions
36
angular/app/components/login-form/login-form.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
class LoginFormController{ | ||
constructor(){ | ||
'ngInject'; | ||
class LoginFormController { | ||
constructor($auth) { | ||
'ngInject'; | ||
|
||
this.email = ''; | ||
this.password = ''; | ||
} | ||
this.$auth = $auth; | ||
|
||
this.email = ''; | ||
this.password = ''; | ||
} | ||
|
||
login() { | ||
var user = { | ||
email: this.email, | ||
password: this.password | ||
}; | ||
|
||
this.$auth.login(user) | ||
.then((response) => { | ||
this.$auth.setToken(response.data.data.token); | ||
}); | ||
} | ||
} | ||
|
||
export const LoginFormComponent = { | ||
templateUrl: './views/app/components/login-form/login-form.component.html', | ||
controller: LoginFormController, | ||
controllerAs: 'vm', | ||
bindings: {} | ||
templateUrl: './views/app/components/login-form/login-form.component.html', | ||
controller: LoginFormController, | ||
controllerAs: 'vm', | ||
bindings: {} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters