ark-ng-config
v0.0.3
Published
Angular Utility Library For Reading & Writing Global Varialbes
Downloads
10
Maintainers
Readme
Angular Utility Library For Reading Global Varialbes!
Simple angular utility library which can be used to read Global variables which can be used as a config key value
npm i ark-ng-config
Documentation
1. Use in Component
import { ArkConfig } from 'ark-ng-config';
export class AppComponent {
constructor(private config: ArkConfig)
getConfigValue() {
console.log(this.config.getValue('globalvar')); // var globalvar = 'some value';
}
}
functions:
-- this.config.getValue('globalvar')
-- this.config.getIp(); // Returns the current public ip (used - ipify.org internally)
-- this.config.setValue<T>('varname', valueofTypeT)
Note: include 'HttpClientModule' in app.module.ts, since this is used to detect IP
import { HttpClientModule } from '@angular/common/http';
imports: [
HttpClientModule
]
Tested on modern browsers
Issues: [email protected]