Skip to content

Commit f618bdf

Browse files
committed
adding code for the second example project
1 parent 0a22951 commit f618bdf

File tree

16 files changed

+548
-3
lines changed

16 files changed

+548
-3
lines changed

angular.json

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,94 @@
8181
}
8282
}
8383
}
84+
},
85+
"00-basic-app": {
86+
"projectType": "application",
87+
"schematics": {},
88+
"root": "projects/00-basic-app",
89+
"sourceRoot": "projects/00-basic-app/src",
90+
"prefix": "app",
91+
"architect": {
92+
"build": {
93+
"builder": "@angular-devkit/build-angular:application",
94+
"options": {
95+
"outputPath": "dist/00-basic-app",
96+
"index": "projects/00-basic-app/src/index.html",
97+
"browser": "projects/00-basic-app/src/main.ts",
98+
"polyfills": [
99+
"zone.js"
100+
],
101+
"tsConfig": "projects/00-basic-app/tsconfig.app.json",
102+
"assets": [
103+
"projects/00-basic-app/src/favicon.ico",
104+
"projects/00-basic-app/src/assets"
105+
],
106+
"styles": [
107+
"projects/00-basic-app/src/styles.css"
108+
],
109+
"scripts": []
110+
},
111+
"configurations": {
112+
"production": {
113+
"budgets": [
114+
{
115+
"type": "initial",
116+
"maximumWarning": "500kb",
117+
"maximumError": "1mb"
118+
},
119+
{
120+
"type": "anyComponentStyle",
121+
"maximumWarning": "2kb",
122+
"maximumError": "4kb"
123+
}
124+
],
125+
"outputHashing": "all"
126+
},
127+
"development": {
128+
"optimization": false,
129+
"extractLicenses": false,
130+
"sourceMap": true
131+
}
132+
},
133+
"defaultConfiguration": "production"
134+
},
135+
"serve": {
136+
"builder": "@angular-devkit/build-angular:dev-server",
137+
"configurations": {
138+
"production": {
139+
"buildTarget": "00-basic-app:build:production"
140+
},
141+
"development": {
142+
"buildTarget": "00-basic-app:build:development"
143+
}
144+
},
145+
"defaultConfiguration": "development"
146+
},
147+
"extract-i18n": {
148+
"builder": "@angular-devkit/build-angular:extract-i18n",
149+
"options": {
150+
"buildTarget": "00-basic-app:build"
151+
}
152+
},
153+
"test": {
154+
"builder": "@angular-devkit/build-angular:karma",
155+
"options": {
156+
"polyfills": [
157+
"zone.js",
158+
"zone.js/testing"
159+
],
160+
"tsConfig": "projects/00-basic-app/tsconfig.spec.json",
161+
"assets": [
162+
"projects/00-basic-app/src/favicon.ico",
163+
"projects/00-basic-app/src/assets"
164+
],
165+
"styles": [
166+
"projects/00-basic-app/src/styles.css"
167+
],
168+
"scripts": []
169+
}
170+
}
171+
}
84172
}
85173
},
86174
"cli": {

projects/00-basic-app/README

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 00-basic-app
2+
3+
In this example your task is to update this application code to enable it to run.
4+
5+
Did you know you can see these instructions formatted by pressing
6+
7+
- Mac - CMD + SHIFT + V?
8+
- Win/Lin - CTRL + SHIFT + V
9+
10+
## Instructions.
11+
12+
1. In `src/main.ts`, add the following code to the end of the file.
13+
14+
```ts
15+
bootstrapApplication(AppComponent, appConfig).catch((err) =>
16+
console.error(err)
17+
);
18+
```
19+
20+
2. Save your changes.
21+
22+
3. From the command line, root directory `angular-fundamentals-lessons`, run the following command:
23+
24+
```bash
25+
ng serve 00-basic-app
26+
```
27+
28+
The application will properly load and be visible in the browser.

projects/00-basic-app/src/app/app.component.css

Whitespace-only changes.

projects/00-basic-app/src/app/app.component.html

Lines changed: 336 additions & 0 deletions
Large diffs are not rendered by default.

projects/01-hello-angular/src/app/app.component.spec.ts renamed to projects/00-basic-app/src/app/app.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ describe('AppComponent', () => {
1414
expect(app).toBeTruthy();
1515
});
1616

17-
it(`should have the '01-hello-angular' title`, () => {
17+
it(`should have the '00-basic-app' title`, () => {
1818
const fixture = TestBed.createComponent(AppComponent);
1919
const app = fixture.componentInstance;
20-
expect(app.title).toEqual('01-hello-angular');
20+
expect(app.title).toEqual('00-basic-app');
2121
});
2222

2323
it('should render title', () => {
2424
const fixture = TestBed.createComponent(AppComponent);
2525
fixture.detectChanges();
2626
const compiled = fixture.nativeElement as HTMLElement;
27-
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, 01-hello-angular');
27+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, 00-basic-app');
2828
});
2929
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { RouterOutlet } from '@angular/router';
4+
5+
@Component({
6+
selector: 'app-root',
7+
standalone: true,
8+
imports: [CommonModule, RouterOutlet],
9+
templateUrl: './app.component.html',
10+
styleUrl: './app.component.css'
11+
})
12+
export class AppComponent {
13+
title = '00-basic-app';
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ApplicationConfig } from '@angular/core';
2+
import { provideRouter } from '@angular/router';
3+
4+
import { routes } from './app.routes';
5+
6+
export const appConfig: ApplicationConfig = {
7+
providers: [provideRouter(routes)]
8+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Routes } from '@angular/router';
2+
3+
export const routes: Routes = [];

projects/00-basic-app/src/assets/.gitkeep

Whitespace-only changes.

projects/00-basic-app/src/favicon.ico

14.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)