I'm using Angular 14. In my angular.json file I have
"serve": {
"builder": "ngx-build-plus:dev-server",
"configurations": {
"production": {
...
"development": {
"browserTarget": "my-app:build:development"
}
},
"defaultConfiguration": "development",
"options": {
"port": 4204,
"publicHost": "http://localhost:8005",
"extraWebpackConfig": "webpack.config.js"
}
},
I would like to know how I can get the value of the "publicHost" in an injectable service I have, for example
@Injectable({
providedIn: 'root'
})
export class AppService {
public getPublicHost() {
...
}
}
It is not an option to return "windnow.location.host" only because this particular application runs as a remote application within a larger shell application using Angular's module federation. What I have learend is that in such a configuration, "windnow.location.host" only returns the URL of the parent (shell) application and not the remote.