This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // app.component.ts | |
| import { Component } from '@angular/core'; | |
| import { CfgService } from './cfg.service'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'] | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AppCfg } from '../cfg.service'; | |
| /** | |
| * enviorment has a type of AppCfg | |
| */ | |
| export const enviorment: AppCfg { | |
| production: true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { NgModule } from '@angular/core'; | |
| import { AppComponent } from './app.component'; | |
| import { APP_CFG } from './cfg.service'; | |
| import { environment } from '../environments/environment'; | |
| @NgModule({ | |
| declarations: [AppComponent], | |
| imports: [BrowserModule], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const APP_CFG = new InjectionToken<string>('APP_CFG'); | |
| export interface AppCfg { | |
| production: boolean; | |
| // extra attributes | |
| [id: string]: any; | |
| }; | |
| @Injectable({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // app.component.ts | |
| import { Component } from '@angular/core'; | |
| import { environment } from '../environments/environment'; // file path | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'] | |
| }) |