Skip to content

fix issue when using constructor with custom arguments#46

Open
anthrax63 wants to merge 1 commit into
ColonelBundy:masterfrom
anthrax63:master
Open

fix issue when using constructor with custom arguments#46
anthrax63 wants to merge 1 commit into
ColonelBundy:masterfrom
anthrax63:master

Conversation

@anthrax63
Copy link
Copy Markdown

@anthrax63 anthrax63 commented May 6, 2022

Problem:
When i use constructor with some custom arguments like this:

@Service({
    name: 'hello-service',
    constructOverride: false,
})
class HelloService extends moleculer.Service {
    constructor(broker: ServiceBroker, private readonly param1: string, private readonly param2: string) {
        super(broker);
    }

    @Action({
        name: 'say.hello',
    })
    async sayHello() {
        return 'Hello!';
    }
}

any additional parameters are lost because only 2 parameters are passed to the superclass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant