Akita: [FeatureRequest] NgEntityService: baseUrl is undefined. Need return the value or ... globalConfig should be public variable instead of private variable

Created on 23 Nov 2019  Â·  2Comments  Â·  Source: datorama/akita

I'm submitting a...


[x] Feature request

Current behavior

Yeah, in this image you can see that weatherService.baseUrl return undefined but the globalConfig return the value I need. I would like to access baseUrl so I can make some httpClient request inside service file. Because I'm trying reuse akita from library.

image

here it is in my project
image

Expected behavior

xxxService.baseUrl return value from globalConfig as default if user unset.
Or you can public globalConfig

Minimal reproduction of the problem with instructions

stackblitz

What is the motivation / use case for changing the behavior?

I'm using akita as library, so I want to reuse many place, then I want to make an specific query from httpClient like this image, but the baseUrl not there for me.

image

Environment


Angular version:8.2.11


Browser:
- [x] Chrome (desktop) version XX

For Tooling issues:
- Node version: v10.16.2
- Platform:  Windows 

Others:

BTW: Other question here, while using akita in angular library, did you ever seen that, do you know how to fix that? You can answer or not, thanks you so much sir:

WARNING: No name was provided for external module '@datorama/akita' in output.globals – guessing 'akita'      
WARNING: No name was provided for external module '@datorama/akita-ng-entity-service' in output.globals – guessing 'akitaNgEntityService'

image

Have a good day

Most helpful comment

I've added a getConfig method, you can use it. Btw, you can change two things in your current code:

  1. There is no need to inject HttpClient, you can call this.getHttp().
  2. You can use the new setLoading operator.

All 2 comments

I've added a getConfig method, you can use it. Btw, you can change two things in your current code:

  1. There is no need to inject HttpClient, you can call this.getHttp().
  2. You can use the new setLoading operator.

thanks you sir, have a good day

Was this page helpful?
0 / 5 - 0 ratings