Concatenate env variables in environment.ts

Viewed 2793

I'd like to reduce some redundancy in my environment.ts, as many of my env variables start with the same. So what I wanted to do is this:

export const environment = {
    base_url: '//www.myWebsite.co.uk/',
    ws_base_url: this.base_url + 'ws',
    download_base_url: this.base_url + 'download'
}

Rather then:

export const environment = {
    base_url: '//www.myWebsite.co.uk/',
    ws_base_url: '//www.myWebsite.co.uk/ws',
    download_base_url: '//www.myWebsite.co.uk/download'
}

But when I use the environment.ws_base_url I don't get //www.myWebsite.co.uk/ws, but undefined/ws. I was just wondering if this is really not working or if I'm just missing something.

3 Answers
Related