Skip to content

Commit aee1f43

Browse files
committed
feat(client): Example of environments file
1 parent 4d5f2db commit aee1f43

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

client/src/app/app.component.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<mat-toolbar>
2-
<span>angular-nest</span>
2+
<span> angular-nest </span>
3+
4+
@if (!isProduction) {
5+
&nbsp;
6+
<small>(dev)</small>
7+
}
38
</mat-toolbar>
49

510
<div class="content">

client/src/app/app.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { RouterOutlet } from '@angular/router';
55
import { MaterialModule } from '../material.module';
66
import { ApiService } from '../.api-client/services/api.service';
77
import { Article } from '../.api-client/models/article';
8+
import { environment } from 'src/environments/environment';
89

910
@Component({
1011
selector: 'app-root',
@@ -17,6 +18,8 @@ export class AppComponent {
1718
$exampleText!: Observable<string>;
1819
$exampleArticle!: Observable<Article>;
1920

21+
isProduction = environment.production;
22+
2023
constructor(private api: ApiService) {}
2124

2225
getExampleText() {
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export const environment = {};
1+
export const environment = {
2+
production: false,
3+
};
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export const environment = {};
1+
export const environment = {
2+
production: true,
3+
};

client/src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { enableProdMode, importProvidersFrom } from '@angular/core';
1+
import { importProvidersFrom } from '@angular/core';
22
import { bootstrapApplication } from '@angular/platform-browser';
33
import { provideAnimations } from '@angular/platform-browser/animations';
4-
import { environment } from './environments/environment.development';
54
import { AppComponent } from './app/app.component';
65
import { ApiModule } from 'src/.api-client/api.module';
76
import {

0 commit comments

Comments
 (0)