In my service, I am using a http
post. I want to set the URL as a constant.
return this.http.get(this.config.API_URL+\'users\', options).map(res=&g
I'm not sure if i understand your question but if you want to create constants, you can do it in a different class and import it.
constants.ts
export class Constants {
public static get HOME_URL(): string { return "sample/url/"; };
}
sample.component.ts
import { Constants } from "./constants";
@Component({
})
export class SampleComponent {
constructor() {
let url = Constants.HOME_URL;
}
}