How does remult
injection into BackendMethods in Deno work?
#181
-
Is there anything specific I have to do to prompt Remult to inject a Filing this as a discussion for now as I'm not convinced it's a bug, but I'll bring it over to issues if necessary. import { Model } from "model.ts"
export class ThingController {
@BackendMethod({allowed: true})
static async doThing(arg1: string, arg2: string, remult?: Remult) {
const repo = remult!.repo(Model) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ChrisRimmer, There are several options you can use: Option 1 - Add "emitDecoratorMetadata" to deno:Change {
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
},
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata":true
},
"importMap": "./import_map.json"
}
It spits out a warning saying that the option was ignored - but it is not ignored, and it works. option 2 - specify parameter type:In the @BackendMethod({allowed: true, paramTypes: [String,String,Remult}) Check it out and let me know |
Beta Was this translation helpful? Give feedback.
Hi @ChrisRimmer,
There are several options you can use:
Option 1 - Add "emitDecoratorMetadata" to deno:
Change
deno.json
It spits out a warning saying that the option was ignored - but it is not ignored, and it works.
option 2 - specify parameter type:
In the
BackendMethod
decorator, specify the parameter types:Check it out and let me know