Comments (3)
Hello.
Yes... There is a problem with using services in resources.
I would propose to use it that way
export class MyService {
static instance: MyService;
constructor() {
MyService.instance = this;
}
doMagic() {
console.log('Booom!');
}
}
Thank in your resource
export class UnitRes extends Resource {
myMethod() {
MyService.instance.doMagic()
}
}
from ngx-resource.
@anfluff try 1.4.0 Injection works now
from ngx-resource.
Thank's to @magnitronus.
Closing the issue.
from ngx-resource.
Related Issues (20)
- @ResourceAction decorator doesn't respect "headers" parameter HOT 2
- Migrating to angular 5? HOT 1
- Response Interceptor HOT 1
- then is not a function in IResourceMethodPromise HOT 3
- Abort request in 7.0? HOT 2
- Switching to ResourceCRUDObservable 2x requests HOT 12
- Intercept array response in 7.0 HOT 2
- Promise rejected for resource declared in custom ngModule HOT 2
- Generic ModuleWithProviders get an error HOT 3
- Unable to build with Angular 9 - ResourceModule.forRoot returns a ModuleWithProviders type without a generic type argument. HOT 1
- resultFactory returns wrong value in case of array of numbers in the response
- Support for Angular 10 HOT 4
- Cannot customize the name and type of the id property for CRUD
- How to cancel the request
- Howto retry request HOT 2
- Old deprecated ngx-resource - how to define responseType. HOT 3
- Uploading yaml file
- ResourceAction decorator not working
- Type error after updatin to Angular 15
- Send array of params joined by & HOT 1
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-resource.