Last active
March 24, 2021 05:46
-
-
Save pablotolentino/9728edecad6316d3fbf333cad803aa78 to your computer and use it in GitHub Desktop.
This file contains 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 class AppComponent implements OnInit { | |
constructor(private httpClient: HttpClient) { | |
} | |
private config: {version: string}; | |
ngOnInit() { | |
this.config = require("./../assets/config.json"); | |
console.log(this.config.version); | |
const headers = new HttpHeaders() | |
.set('Cache-Control', 'no-cache') | |
.set('Pragma', 'no-cache'); | |
this.httpClient | |
.get<{ version: string }>("/assets/config.json", {headers}) | |
.subscribe(config => { | |
console.log(config); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment