Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<!--The whole content below can be removed with the new code.-->
<div style="text-align:center">
<h1>
{{title}}!!
</h1>
<app-login></app-login>
</div>

<div class="page">
<app-toolbar title="UltiCar"></app-toolbar>
<div class="main">
<div class="navLinks">
<a [routerLink]="['']">Register</a>
<a [routerLink]="['/login']">Sign In</a>
</div>
<div id="routing">
<div class="container">
<router-outlet></router-outlet>
</div>
</div>
</div>

6 changes: 6 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.page {
background-color: rgb(31, 95, 121);
}
.main {
text-align: center;
}
32 changes: 0 additions & 32 deletions src/app/app.component.spec.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'Lit';
title = 'UltiCar';
}
13 changes: 9 additions & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { Routes, RouterModule } from '@angular/router';
import { FeCommonModule } from './common/common.module';
import { AppComponent } from './app.component';
import { LoginComponent } from 'app/common/components/smart/login/login.component';

import { MatButtonModule, MatCheckboxModule} from '@angular/material';
const routes:Routes = [
{path: '', redirectTo: 'login', pathMatch: 'full'},
{path: 'login', component: LoginComponent},
{path: 'dashboard', component: LoginComponent}
]

@NgModule({
declarations: [
Expand All @@ -14,9 +19,9 @@ import { MatButtonModule, MatCheckboxModule} from '@angular/material';
imports: [
BrowserModule,
BrowserAnimationsModule,
FeCommonModule
FeCommonModule,
RouterModule.forRoot(routes)
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
14 changes: 10 additions & 4 deletions src/app/common/common.module.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { TextBoxComponent } from './components/presentation/text-box/text-box.component';
import { LoginComponent } from './components/smart/login/login.component';
import { CheckBoxComponent } from './components/presentation/check-box/check-box.component';
import { ToolbarComponent } from './components/presentation/toolbar/toolbar.component';
import { RaisedButtonComponent } from './components/presentation/raised-button/raised-button.component';
import { BasicButtonComponent } from './components/presentation/basic-button/basic-button.component';
import { IconButtonComponent } from './components/presentation/icon-button/icon-button.component';
import { MatToolbarModule, MatCheckboxModule, MatButtonModule, MatFormFieldModule, MatFormFieldControl, MatInputModule, MatIconModule, MatCardModule } from '@angular/material';

@NgModule({
imports: [
CommonModule
CommonModule, MatToolbarModule, MatCheckboxModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatIconModule, MatCardModule, FormsModule
],
declarations: [TextBoxComponent, LoginComponent, CheckBoxComponent],
exports: [
LoginComponent, TextBoxComponent, CheckBoxComponent]
declarations: [TextBoxComponent, LoginComponent, CheckBoxComponent, ToolbarComponent, RaisedButtonComponent, BasicButtonComponent, IconButtonComponent],
exports: [ToolbarComponent],
})

export class FeCommonModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<button mat-button [color]="color" (click)="click($event)">{{label}}</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mat-button {
min-width: 200px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

@Component({
selector: 'app-basic-button',
templateUrl: './basic-button.component.html',
styleUrls: ['./basic-button.component.scss']
})
export class BasicButtonComponent implements OnInit {

@Input() private label:string
@Input() private color:string

@Output() public clickEvent:EventEmitter<any> = new EventEmitter();

constructor() { }

ngOnInit() {
}

click(event) {
this.clickEvent.emit(event);
}

}
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<p>
DRIVER-CHECKBOX
</p>
<mat-checkbox [color]="color" [(ngModel)]="checkboxValue" (ngModelChange)="onChange($event)">{{label}}</mat-checkbox>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

@Component({
selector: 'app-check-box',
Expand All @@ -7,9 +7,21 @@ import { Component, OnInit } from '@angular/core';
})
export class CheckBoxComponent implements OnInit {

@Input() private label: string
@Input() private color: string
@Input() private checkboxValue:boolean

@Output() checkboxChange:EventEmitter<any> = new EventEmitter();

constructor() { }

ngOnInit() {
}

onChange(newValue) {
this.checkboxValue = newValue;
console.log("The checkbox value is: " + newValue);
this.checkboxChange.emit(newValue);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<button mat-icon-button>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need a click event emitter

<mat-icon aria-label="icon-button" (click)="click($event)">{{icon}}</mat-icon>
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

@Component({
selector: 'app-icon-button',
templateUrl: './icon-button.component.html',
styleUrls: ['./icon-button.component.scss']
})
export class IconButtonComponent implements OnInit {

@Input() private icon:string;

@Output() public clickEvent:EventEmitter<any> = new EventEmitter();

constructor() { }

ngOnInit() {
}

click($event) {
this.clickEvent.emit(event);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<button mat-raised-button [color]="color" (click)="click($event)" [disabled]="disabled">{{label}}</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mat-raised-button {
min-width: 200px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Component, OnInit, Input, Output, HostListener, EventEmitter } from '@angular/core';
import { RouterModule, Routes} from '@angular/router';

@Component({
selector: 'app-raised-button',
templateUrl: './raised-button.component.html',
styleUrls: ['./raised-button.component.scss']
})
export class RaisedButtonComponent implements OnInit {

@Input() private label:string
@Input() private color:string
@Input() private disabled:string

@Output() public clickEvent:EventEmitter<any> = new EventEmitter();

constructor() { }

ngOnInit() {
}

click(event) {
this.clickEvent.emit(event);
}

}
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<input type="text" [id]="id" [placeholder]="placeholder" [value]="value" (click)="click($event)" />
<div class="form-template">
<mat-form-field [color]="primary">
<input matInput placeholder={{placeholder}} [(ngModel)]="textboxValue" (ngModelChange)="onChange($event)" [type]="hide ? 'password' : 'text'">
<mat-icon *ngIf="encryption" matSuffix (click)="hide = !hide">{{hide ? 'lock_outline' : 'lock_open'}}</mat-icon>
<mat-icon *ngIf="icon" matSuffix>{{icon}}</mat-icon>
</mat-form-field>
</div>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';

@Component({
selector: 'app-text-box',
templateUrl: './text-box.component.html',
styleUrls: ['./text-box.component.scss']
})
export class TextBoxComponent implements OnInit {
@Input() private id: string
@Input() private placeholder: string
private value: string
@Input() private id:string
@Input() private placeholder:string
@Input() private encryption:string
@Input() private icon:string
@Input() private textboxValue:string

@Output() textboxChange:EventEmitter<String> = new EventEmitter<String>();

constructor() { }

ngOnInit() {
this.value = 'hello'
ngOnInit() {}

onChange(event) {
console.log(this.textboxValue);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<mat-toolbar color="primary">
<app-icon-button icon="home" (click)="goHome($event)"></app-icon-button>
<span>{{title}}</span>
</mat-toolbar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.my-sidenav {
padding: 10px;
background-color:#00BCD4;
}

.sidenav-content {
display: flex;
height: 100%;
align-items: center;
justify-content: center;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Component, OnInit, Input } from '@angular/core';

@Component({
selector: 'app-toolbar',
templateUrl: './toolbar.component.html',
styleUrls: ['./toolbar.component.scss']
})
export class ToolbarComponent implements OnInit {

@Input() private title:string

constructor() { }

ngOnInit() {
}

goHome(event) {
console.log("Clicked home: " + event);
}

}
Loading