I've Constants.js
file with below variables defined.
var baseApiUrl = "/api";
var ConstantAPI = {
employee: baseApiUrl + "/employee",
}
and I'm accessing using ConstantAPI.employee
I've Constants.ts
as well. How can I access baseApiUrl
in .ts
file.
I'm trying like below
export class DataService {
constructor(@Inject(HttpClient) private http: HttpClient) {
}
getEmployess(): Observable<any> {
var url = ConstantAPI.employee; // Error: Cannot find name 'ConstantAPI'
return this.http.post(url, searchData, options)
}
}