This repository has been archived by the owner on Nov 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18c5a1d
commit 174aac0
Showing
7 changed files
with
77 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
(function () { | ||
|
||
function LoginController() { | ||
angular | ||
.module('clash-royale-api') | ||
.controller('LoginController', LoginController); | ||
|
||
LoginController.$inject = ['LoginService']; | ||
|
||
function LoginController(LoginService) { | ||
var vm = this; | ||
vm.title = 'Log In'; | ||
} | ||
vm.model = {}; | ||
vm.fields = [ | ||
{ | ||
key: 'user', | ||
type: 'input', | ||
templateOptions: { | ||
label: 'User', | ||
required: true | ||
} | ||
}, | ||
{ | ||
key: 'password', | ||
type: 'input', | ||
templateOptions: { | ||
label: 'Password', | ||
required: true, | ||
type: 'password', | ||
} | ||
}, | ||
]; | ||
|
||
angular | ||
.module('clash-royale-api') | ||
.controller('LoginController', LoginController); | ||
vm.submit = function(model) { | ||
LoginService.authenticate(model); | ||
} | ||
} | ||
|
||
})(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.form-signin { | ||
min-height: 100vh; | ||
padding: 15px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} |
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,12 +1,29 @@ | ||
<div> | ||
<div class="jumbotron text-center"> | ||
<h1>{{ vm.title }}</h1> | ||
<div class="container"> | ||
<nav class="navbar navbar-inverse"> | ||
<div class="navbar-header"> | ||
<a class="navbar-brand" href="/"> | ||
Clash Royale API | ||
</a> | ||
</div> | ||
<div class="collapse navbar-collapse"> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li><a ui-sref="arenas">Arenas</a></li> | ||
<li><a ui-sref="cards">Cards</a></li> | ||
<li><a ui-sref="chests">Chests</a></li> | ||
<li><a ui-sref="players">Players</a></li> | ||
</ul> | ||
</div> | ||
</nav> | ||
<div> | ||
<div class="jumbotron text-center"> | ||
<h1>{{ vm.title }}</h1> | ||
</div> | ||
<form ng-submit="vm.submit(vm.model)" novalidate> | ||
<formly-form model="vm.model" fields="vm.fields" form="vm.form"> | ||
<button type="submit" ng-disabled="vm.form.$invalid" class="btn btn-default">Submit</button> | ||
</formly-form> | ||
</form> | ||
<h2>{{ vm.previewTitle }}</h2> | ||
<pre>{{ vm.model | json }}</pre> | ||
</div> | ||
<form ng-submit="vm.submit(vm.model)" novalidate> | ||
<formly-form model="vm.model" fields="vm.fields" form="vm.form"> | ||
<button type="submit" ng-disabled="vm.form.$invalid" class="btn btn-default">Submit</button> | ||
</formly-form> | ||
</form> | ||
<h2>{{ vm.previewTitle }}</h2> | ||
<pre>{{ vm.model | json }}</pre> | ||
</div> |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="container"> | ||
<form class="form-signin" ng-submit="vm.submit(vm.model)" novalidate> | ||
<formly-form model="vm.model" fields="vm.fields" form="vm.form"> | ||
<button type="submit" ng-disabled="vm.form.$invalid" class="btn btn-default">Submit</button> | ||
</formly-form> | ||
</form> | ||
</div> |
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