diff options
author | crupest <crupest@outlook.com> | 2019-02-04 23:25:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-02-04 23:25:33 +0800 |
commit | 4fea4164fad943eebc1850042994fdbaad3682f9 (patch) | |
tree | 36522d986769b0520afd53a791674644305a1dd1 /Timeline/ClientApp/src/app/home | |
download | timeline-4fea4164fad943eebc1850042994fdbaad3682f9.tar.gz timeline-4fea4164fad943eebc1850042994fdbaad3682f9.tar.bz2 timeline-4fea4164fad943eebc1850042994fdbaad3682f9.zip |
Init commit.
Diffstat (limited to 'Timeline/ClientApp/src/app/home')
-rw-r--r-- | Timeline/ClientApp/src/app/home/home.component.css | 49 | ||||
-rw-r--r-- | Timeline/ClientApp/src/app/home/home.component.html | 22 | ||||
-rw-r--r-- | Timeline/ClientApp/src/app/home/home.component.spec.ts | 25 | ||||
-rw-r--r-- | Timeline/ClientApp/src/app/home/home.component.ts | 27 |
4 files changed, 123 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/home/home.component.css b/Timeline/ClientApp/src/app/home/home.component.css new file mode 100644 index 00000000..76297a9e --- /dev/null +++ b/Timeline/ClientApp/src/app/home/home.component.css @@ -0,0 +1,49 @@ +p { + font-size: 2rem; + margin: 0; +} + +.bold { + font-weight: 600; +} + +#loginBox { + display: inline-grid; + grid-template: "username-label username-input" auto + "password-label password-input" auto + "login-button login-button" auto + "message message" auto + / max-content max-content; + align-items: center; + padding: 10px; + border: solid black 1px; +} + +#usernameLabel { + grid-area: username-label; +} + +#usernameInput { + grid-area: username-input; + margin: 2px; +} + +#passwordLabel { + grid-area: password-label; +} + +#passwordInput { + grid-area: password-input; + margin: 2px; +} + +#loginButton { + grid-area: login-button; + justify-self: end; +} + +#loginMessage { + grid-area: message; + justify-self: end; + color: red; +} diff --git a/Timeline/ClientApp/src/app/home/home.component.html b/Timeline/ClientApp/src/app/home/home.component.html new file mode 100644 index 00000000..c3c9ed73 --- /dev/null +++ b/Timeline/ClientApp/src/app/home/home.component.html @@ -0,0 +1,22 @@ +<h2> + This page is under <span class="bold">construction</span>! +</h2> + +<h2> + To-do list: +</h2> + +<ol> + <li>Learn DI and Service module in Angular.</li> + <li>Develop basic authentication module.</li> + <li>Learn Bootstrap.</li> +</ol> + +<div id="loginBox"> + <label id="usernameLabel">username</label> + <input id="usernameInput" type="text" [(ngModel)]="loginInfo.username"> + <label id="passwordLabel">password</label> + <input id="passwordInput" type="password" [(ngModel)]="loginInfo.password"> + <input id="loginButton" type="button" value="Login" (click)="tryLogin()"> + <div id="loginMessage">{{message}}</div> +</div> diff --git a/Timeline/ClientApp/src/app/home/home.component.spec.ts b/Timeline/ClientApp/src/app/home/home.component.spec.ts new file mode 100644 index 00000000..490e81bd --- /dev/null +++ b/Timeline/ClientApp/src/app/home/home.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeComponent } from './home.component'; + +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture<HomeComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HomeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Timeline/ClientApp/src/app/home/home.component.ts b/Timeline/ClientApp/src/app/home/home.component.ts new file mode 100644 index 00000000..873aee7f --- /dev/null +++ b/Timeline/ClientApp/src/app/home/home.component.ts @@ -0,0 +1,27 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; + +class LoginInfo { + username = ''; + password = ''; +} + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.css'] +}) +export class HomeComponent implements OnInit { + + loginInfo = new LoginInfo(); + message = ''; + + constructor(/* private http: HttpClient */) { } + + ngOnInit() { + } + + tryLogin() { + alert('Not implemented!!!'); + } +} |