Comments (7)
Oh! ok....
I'm thinking on a feature... We can atach new method on service for specials URIs, o just a particular service base url... 🤔
from ngx-jsonapi.
Created new pull request with solution for this issue.
Waiting for your merge...
from ngx-jsonapi.
hi @ZeevKatz,
yeap! you can do with any service. For example:
@Injectable()
export class AuthorsService extends Service<Author> {
public resource = Author;
public type = 'authors';
public schema: ISchema = {
relationships: {
photos: {
hasMany: true
}
}
};
public getPath(): string {
return 'my_particular_path_for_this_resource_type';
}
}
from ngx-jsonapi.
Maybe I was uncleared, I'd like to change the api host and not a specific service path.
from ngx-jsonapi.
Hi @pablorsk,
Please let me know if there are issues with my last pull request that related to this issue.
Jan 30 was really far from now and this is a really important change,
Thanks.
from ngx-jsonapi.
I am not sure if i am not too late for possible solution. But maybe it will help for someone one day. Use case is to have one api url for deployment and other for prod. Also not 100% clear that it gonna work for all but you'll get idea.
Create folder under root "environments" with two files
environment.ts
export const environment = {
production: false,
someEndpoint : 'http://localhost:55180/',
anotherEndPoint : "http://localhost:55009/x-files/"
};
environment.prod.ts
export const environment = {
production: true,
someEndpoint : 'http://api.superdomain.com/',
anotherEndPoint : "http://api.superdomain.com/no-files/"
};
And then in you service you could use
private rootUrl = environment.someEndpoint + "x-files-documents/";
public getPath(): string {
return this.rootUrl;
}
So when you build with flag prod it gonna take variables from prod file. Easy peasy.
from ngx-jsonapi.
In Multinexo, @valentasm1, we have a very similar code.
from ngx-jsonapi.
Related Issues (20)
- Resource: "hasOneRelated" check failed after calling "removeRelationship" and saved
- Add the ability to set a custom UrlParamsBuilder
- Add secondary entry point for LocalStore feature
- Congratulations and question
- Uncaught Error: Type NgxJsonapiModule does not have 'ɵmod' property. HOT 2
- PATCH Save does not support response 200 with content null
- Demo site "Online JSON API client" does not work again, since the server does not give permission for CORS
- '&' in remotefilter is not properly URL serialized HOT 1
- Access to element of array is undefined HOT 3
- Cannot parse relationship data into Resource because of different between `type` and relationship key HOT 1
- unit test error
- Is there a way to disable all caching in v2.2.3? The old methods don't seem to work anymore
- [v3.0.0] Examples show JsonRipper and StoreService imports but they are not in the public_api file HOT 1
- The cache does not work with fields property
- How to fetch relationships? HOT 2
- Can't intercept http requests since v3.0.0-dev HOT 5
- Relationships only included when corresponding service is constructed HOT 1
- Pagination meta is undefined
- Custom http params/filtering
- [3.0.2] Vulnerable dependencies axios and dexie
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-jsonapi.