Skip to content

Commit

Permalink
Merge pull request #1 from actionanand/features/1-template-driven
Browse files Browse the repository at this point in the history
starting project
  • Loading branch information
actionanand authored Sep 28, 2024
2 parents 96d6077 + da8ae78 commit b990237
Show file tree
Hide file tree
Showing 14 changed files with 353 additions and 34 deletions.
Binary file added public/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{ title }}
<header>
<img src="logo.jpg" alt="A form and a pencil" />
<h1>Angular Forms</h1>
</header>


<router-outlet />
<app-login />
10 changes: 4 additions & 6 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';

import { LoginComponent } from './auth/login/login.component';

@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
imports: [LoginComponent],
})
export class AppComponent {
title = 'Essentials 18';
}
export class AppComponent {}
8 changes: 0 additions & 8 deletions src/app/app.config.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/app/app.routes.ts

This file was deleted.

11 changes: 11 additions & 0 deletions src/app/auth/login/login.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.control-row {
align-items: flex-end;
}

.control {
flex: 1;
}

button {
padding: 0.6rem 1.75rem;
}
17 changes: 17 additions & 0 deletions src/app/auth/login/login.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<form>
<h2>Login</h2>

<div class="control-row">
<div class="control no-margin">
<label for="email">Email</label>
<input id="email" type="email" />
</div>

<div class="control no-margin">
<label for="password">Password</label>
<input id="password" type="password" />
</div>

<button class="button">Login</button>
</div>
</form>
9 changes: 9 additions & 0 deletions src/app/auth/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-login',
standalone: true,
templateUrl: './login.component.html',
styleUrl: './login.component.css',
})
export class LoginComponent {}
File renamed without changes.
112 changes: 112 additions & 0 deletions src/app/auth/signup/signup.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<form>
<h2>Welcome on board!</h2>
<p>We just need a little bit of data from you to get you started 🚀</p>

<div class="control">
<label for="email">Email</label>
<input id="email" type="email" name="email" />
</div>

<div class="control-row">
<div class="control">
<label for="password">Password</label>
<input id="password" type="password" name="password" />
</div>

<div class="control">
<label for="confirm-password">Confirm Password</label>
<input id="confirm-password" type="password" name="confirm-password" />
</div>
</div>

<hr />

<div>
<div class="control-row">
<div class="control">
<label for="first-name">First Name</label>
<input type="text" id="first-name" name="first-name" />
</div>

<div class="control">
<label for="last-name">Last Name</label>
<input type="text" id="last-name" name="last-name" />
</div>
</div>

<fieldset>
<legend>Your Address</legend>

<div class="control-row">
<div class="control">
<label for="street">Street</label>
<input type="text" id="street" name="street" />
</div>

<div class="control">
<label for="number">Number</label>
<input type="text" id="number" name="number" />
</div>
</div>

<div class="control-row">
<div class="control">
<label for="postal-code">Postal Code</label>
<input type="text" id="postal-code" name="postal-code" />
</div>

<div class="control">
<label for="city">City</label>
<input type="text" id="city" name="city" />
</div>
</div>
</fieldset>
</div>

<hr />

<div class="control-row">
<div class="control">
<label for="role">What best describes your role?</label>
<select id="role" name="role">
<option value="student">Student</option>
<option value="teacher">Teacher</option>
<option value="employee">Employee</option>
<option value="founder">Founder</option>
<option value="other">Other</option>
</select>
</div>
</div>

<fieldset>
<legend>How did you find us?</legend>
<div class="control">
<input type="checkbox" id="google" name="acquisition" value="google" />
<label for="google">Google</label>
</div>

<div class="control">
<input type="checkbox" id="friend" name="acquisition" value="friend" />
<label for="friend">Referred by friend</label>
</div>

<div class="control">
<input type="checkbox" id="other" name="acquisition" value="other" />
<label for="other">Other</label>
</div>
</fieldset>

<div class="control-row">
<div class="control">
<label for="terms-and-conditions">
<input type="checkbox" id="terms-and-conditions" name="terms" />
I agree to the terms and conditions
</label>
</div>
</div>

<p class="form-actions">
<button type="reset" class="button button-flat">Reset</button>
<button type="submit" class="button">Sign up</button>
</p>
</form>
9 changes: 9 additions & 0 deletions src/app/auth/signup/signup.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-signup',
standalone: true,
templateUrl: './signup.component.html',
styleUrl: './signup.component.css',
})
export class SignupComponent {}
20 changes: 10 additions & 10 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Investment Calculator</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
<head>
<meta charset="utf-8" />
<title>Forms</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="logo.jpg" />
</head>
<body>
<app-root></app-root>
</body>
</html>
5 changes: 2 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';

import { AppComponent } from './app/app.component';

bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err));
bootstrapApplication(AppComponent).catch(err => console.error(err));
Loading

0 comments on commit b990237

Please sign in to comment.