Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Client-seitige Web-Anwendungen Übungen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Max Henze
Client-seitige Web-Anwendungen Übungen
Commits
350c62aa
Commit
350c62aa
authored
4 years ago
by
Max Henze
Browse files
Options
Downloads
Patches
Plain Diff
Documentation
parent
1bf57da6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
week03/app/controllers/login.js
+18
-5
18 additions, 5 deletions
week03/app/controllers/login.js
with
18 additions
and
5 deletions
week03/app/controllers/login.js
+
18
−
5
View file @
350c62aa
import
Controller
from
'
@ember/controller
'
;
import
{
tracked
}
from
'
@glimmer/tracking
'
;
import
{
action
}
from
'
@ember/object
'
import
{
action
}
from
'
@ember/object
'
;
/**
* Provides backend functionality for Login Route
*/
export
default
class
LoginController
extends
Controller
{
@
tracked
email
=
''
;
@
tracked
password
=
''
;
@
tracked
loginInvalid
=
false
;
classLabel
=
'
is-invalid-label
'
;
classInput
=
'
is-invalid-input
'
;
/**
* Handles the user submitting the login form.
* Suppresses standard behaviour.
* Tests the email/password and updates the UI.
*/
@
action
login
(
event
)
{
event
.
preventDefault
();
if
(
this
.
email
===
'
test@example.com
'
&&
this
.
password
===
'
password
'
)
{
this
.
loginInvalid
=
false
;
}
else
{
this
.
loginInvalid
=
true
;
}
this
.
loginInvalid
=
false
;
}
else
{
this
.
loginInvalid
=
true
;
}
}
/**
* Handles the user typing in the email/password input fields.
* Resets the ''loginInvalid'' property to improve the usability.
*/
@
action
typing
()
{
this
.
loginInvalid
=
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment