Skip to content

Commit 5cd5366

Browse files
committed
CreateLoginScreen- added models/eventemitters to components, modified UI
1 parent 7194573 commit 5cd5366

18 files changed

+79
-69
lines changed

src/app/common/common.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
3+
import { FormsModule } from '@angular/forms';
34
import { TextBoxComponent } from './components/presentation/text-box/text-box.component';
45
import { LoginComponent } from './components/smart/login/login.component';
56
import { CheckBoxComponent } from './components/presentation/check-box/check-box.component';
@@ -11,7 +12,7 @@ import { MatToolbarModule, MatCheckboxModule, MatButtonModule, MatFormFieldModul
1112

1213
@NgModule({
1314
imports: [
14-
CommonModule, MatToolbarModule, MatCheckboxModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatIconModule, MatCardModule
15+
CommonModule, MatToolbarModule, MatCheckboxModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatIconModule, MatCardModule, FormsModule
1516
],
1617
declarations: [TextBoxComponent, LoginComponent, CheckBoxComponent, ToolbarComponent, RaisedButtonComponent, BasicButtonComponent, IconButtonComponent],
1718
exports: [ToolbarComponent],
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.mat-button {
2+
min-width: 200px;
3+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<mat-checkbox [color]="color">{{label}}</mat-checkbox>
1+
<mat-checkbox [color]="color" [(ngModel)]="checkboxValue" (ngModelChange)="onChange($event)">{{label}}</mat-checkbox>

src/app/common/components/presentation/check-box/check-box.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, Input } from '@angular/core';
1+
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
22

33
@Component({
44
selector: 'app-check-box',
@@ -9,10 +9,19 @@ export class CheckBoxComponent implements OnInit {
99

1010
@Input() private label: string
1111
@Input() private color: string
12+
@Input() private checkboxValue:boolean
13+
14+
@Output() checkboxChange:EventEmitter<any> = new EventEmitter();
1215

1316
constructor() { }
1417

1518
ngOnInit() {
1619
}
1720

21+
onChange(newValue) {
22+
this.checkboxValue = newValue;
23+
console.log("The checkbox value is: " + newValue);
24+
this.checkboxChange.emit(newValue);
25+
}
26+
1827
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<button mat-icon-button>
2-
<mat-icon aria-label="icon-button">{{icon}}</mat-icon>
2+
<mat-icon aria-label="icon-button" (click)="click($event)">{{icon}}</mat-icon>
33
</button>

src/app/common/components/presentation/icon-button/icon-button.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, Input } from '@angular/core';
1+
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
22

33
@Component({
44
selector: 'app-icon-button',
@@ -9,9 +9,15 @@ export class IconButtonComponent implements OnInit {
99

1010
@Input() private icon:string;
1111

12+
@Output() public clickEvent:EventEmitter<any> = new EventEmitter();
13+
1214
constructor() { }
1315

1416
ngOnInit() {
1517
}
1618

19+
click($event) {
20+
this.clickEvent.emit(event);
21+
}
22+
1723
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.mat-raised-button {
2+
min-width: 200px;
3+
}

src/app/common/components/presentation/sidebar/sidebar.component.html

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/app/common/components/presentation/sidebar/sidebar.component.scss

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/app/common/components/presentation/sidebar/sidebar.component.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)