Skip to content

Commit

Permalink
Merge pull request #98 from Kajol-Kumari/add_login_page
Browse files Browse the repository at this point in the history
Added login page UI
  • Loading branch information
rajatkb authored May 19, 2020
2 parents e23db99 + eae5cbc commit 552c238
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 3 deletions.
5 changes: 4 additions & 1 deletion User-App/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { LoginComponent } from './login/login.component';
import { SignupComponent } from './signup/signup.component';
import { HomeComponent } from './home/home.component';
import { SearchPageComponent } from './search-page/search-page.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

@NgModule({
declarations: [
Expand All @@ -38,7 +39,9 @@ import { SearchPageComponent } from './search-page/search-page.component';
MatProgressSpinnerModule,
MatPaginatorModule,
MatInputModule,
FlexLayoutModule
FlexLayoutModule,
FormsModule,
ReactiveFormsModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
24 changes: 24 additions & 0 deletions User-App/src/app/login/login.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.main {
text-align: center;
margin-top: 2%;
}
h2 {
font-size: 28px;
color: rgb(15, 15, 228);
font-weight: 600;
font-family: 'Courier New', Courier, monospace;
}
mat-card {
margin:2% 0% 6% 15%;
padding:4%;
width:60%;
background-color: rgb(241, 239, 239);
font-size: 18px;
}
mat-form-field {
width: 80%;
margin-left: 8%;
}
button{
margin-left: 50%;
}
29 changes: 28 additions & 1 deletion User-App/src/app/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
<p>Welcome to the login page :)</p>
<div class="main">
<h2>LOGIN FORM</h2>
</div>
<mat-card>
<form (submit) = "OnLogin(logInForm)" #logInForm= "ngForm">
<mat-form-field>
<input type="email"
matInput name="email"
ngModel placeholder="Email ID"
#emailId="ngModel"
required email>
<mat-error *ngIf="emailId.invalid">Please Enter a valid Email ID!</mat-error>
</mat-form-field>
<mat-form-field>

<input type="password"
matInput
name = "password"
ngModel
placeholder="Password" #passwordentered="ngModel" required>
<mat-error *ngIf="passwordentered.invalid">Please Enter a valid Password!</mat-error>

</mat-form-field> <br>
<button mat-raised-button color="primary" type="submit">
Login
</button>
</form>
</mat-card>
5 changes: 4 additions & 1 deletion User-App/src/app/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';

@Component({
selector: 'app-login',
Expand All @@ -11,5 +12,7 @@ export class LoginComponent implements OnInit {

ngOnInit(): void {
}

OnLogin(form: NgForm) {
console.log(form);
}
}

0 comments on commit 552c238

Please sign in to comment.