Skip to content
Open
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
11 changes: 10 additions & 1 deletion itenium-socks/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"
Expand Down Expand Up @@ -100,5 +106,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}
35 changes: 35 additions & 0 deletions itenium-socks/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions itenium-socks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@angular/router": "^18.0.0",
"@fortawesome/angular-fontawesome": "^0.15.0",
"@fortawesome/fontawesome-free": "^6.5.2",
"locale-codes": "^1.3.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
Expand Down
6 changes: 6 additions & 0 deletions itenium-socks/src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#notProdIndicator {
position: fixed;
display: inline;
padding:1em;
background-color:lightgreen;
}
3 changes: 3 additions & 0 deletions itenium-socks/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<div [hidden]="this.env.production === true" id="notProdIndicator">
Copy link
Member

Choose a reason for hiding this comment

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

fyi

Je kan this. in templates weglaten
Ook === true hoeft niet (maar sommigen zijn liever expliciet; ik denk team/project decision)

You are not in production :-)
</div>
<router-outlet />
7 changes: 5 additions & 2 deletions itenium-socks/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component } from '@angular/core';
import { Component, LOCALE_ID } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { environment } from '../environments/environment';

@Component({
selector: 'app-root',
Expand All @@ -9,4 +10,6 @@ import { RouterOutlet } from '@angular/router';
],
templateUrl: './app.component.html',
})
export class AppComponent {}
export class AppComponent {
public env = environment;
}
3 changes: 2 additions & 1 deletion itenium-socks/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { ApplicationConfig, provideZoneChangeDetection, LOCALE_ID } from '@angular/core';
import { provideRouter } from '@angular/router';
import { provideHttpClient, withFetch } from '@angular/common/http';

Expand All @@ -9,5 +9,6 @@ export const appConfig: ApplicationConfig = {
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideHttpClient(withFetch()),
{ provide: LOCALE_ID, useValue: 'nl-BE' }
]
};
2 changes: 1 addition & 1 deletion itenium-socks/src/app/home/latest-socks.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>
</div>
<div class="detail-box">
<h6>{{ sock.name }}</h6>
<h6><span>{{ sock.price }}</span></h6>
<h6><span>{{ sock.price | currency : 'EUR' }}</span></h6>
</div>
<div class="new">
<span class="favourite" [style.color]="sock.color"><i class="fa fa-star"></i></span>
Expand Down
11 changes: 8 additions & 3 deletions itenium-socks/src/app/home/latest-socks.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { Component, OnInit } from '@angular/core';
import { Component, LOCALE_ID, OnInit } from '@angular/core';
import { SocksService } from '../socks/socks.service';
import { Observable } from 'rxjs';
import { Sock } from '../socks/sock.model';
import { AsyncPipe, NgFor } from '@angular/common';
import { AsyncPipe, NgFor, CurrencyPipe } from '@angular/common';
import { RouterLink } from '@angular/router';

@Component({
selector: 'app-latest-socks',
standalone: true,
imports: [NgFor, AsyncPipe, RouterLink],
imports: [
NgFor,
AsyncPipe,
RouterLink,
CurrencyPipe
],
templateUrl: './latest-socks.component.html'
})
export class LatestSocksComponent implements OnInit {
Expand Down
3 changes: 3 additions & 0 deletions itenium-socks/src/environments/environment.development.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: false
};
3 changes: 3 additions & 0 deletions itenium-socks/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: true
};
5 changes: 5 additions & 0 deletions itenium-socks/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { registerLocaleData } from '@angular/common';
import localeNlBe from '@angular/common/locales/nl-BE';
import localeNlBeExtra from '@angular/common/locales/extra/nl-BE'

registerLocaleData(localeNlBe, localeNlBeExtra);

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