Using service of app component

Hi CUBA team
I need to use the service from customer application component but i don’t see from editor, is it not possible?

hi, @mortozakhan

It is possible. Take a look at an example in attachments.

Regards,
Daniil.

service-from-appcomponent.zip (147.8 KB)

Thank you for your help

Hi Daniil
Is there any specific trick that you used to inject? I tried in my project but I dont see the app component service in my injection.

Mortoza

No. I’ve just added the app component via CUBA Studio and regenerated Intellij IDEA project files.

Could you share your test project and app component?

Hi
I am able to use the service of App Component in controller but do not find it from the serviceBean of the host Application that is using the app component. Am I missing here anything?

Hello.

Сould you clarify what you mean by the phrase “I don’t find it from the ServiceBean”? Is not this bean injected there?

Regards,
Daniil.

Hi
Yes, the service bean of app component is not injected into the service bean of main/host bean. Any thoughts?

OK, i’ll check your case and give a response soon.

I’ve updated my sample and a service from application component is successfully injected into service in the main project.

Please take a look at updated example:
service-from-appcomponent.zip (249.6 KB)

Regards,
Daniil.

Hi Daniil
Thanks. I was doing the same way though!
What I have noticed that, when I type with import com.myapp.xx then it works but It doesn’t appear when I hit COMMAND+N to inject as follows. May be this is related to the plug-in for IntelliJ

image