Injecting package into constructor

Home Forums Convertigo Products Injecting package into constructor

This topic contains 1 reply, has 2 voices, and was last updated by  jacklinerose11@gmail.com 7 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #238377

    Darren Bryant
    Participant

    I have added a CustomAction into a control in a Mobile Builder 7.5.1 project but I am not seeing how to get the injection into the constructor. I am trying to use the @ionic-native/speech-recognition package and am not sure that I am creating the custom action correctly since the page constructor is not being updated.

    Thanks,

    Darren

    #238378

    admin
    Keymaster

    Hello Darren,

    yes this a very good question.. as you pointed out, there no way to modify the constructor of a Page class. So this is why there is another way to inject an object.
    Just use the :

    obj = this.getInstance(YourObject) ;

    to get an injected Object dynamically.

    Hope That Helps
    Convertigo Support team.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.