Craft 3 Call Own Service I created a plugin for Craft 3 at pluginfactory.io.

I want to call it in my template variable 

public function exampleVariable()
{

    // hint   AdminBar::$plugin-&gt;editLinks-&gt;exampleService()
    //$result = FacebookPageConnector::$plugin-&gt;eventsService-&gt;fetchEvents();
      $result =  FacebookPageConnector::$plugin-&gt;facebookPageConnectorEventsService-&gt;exampleService();

    //$result = FacebookPageConnector::$plugin-&gt;eventsService-&gt;fetchEvents();
    return $result;
}


But whatever I try to name my service, I get an exception like this:


  Getting unknown property: boscho87fbconnector\facebookpageconnector\FacebookPageConnector::facebookPageConnectorEventsService


What are the correct naming conventions?

I saw an example here: https://github.com/wbrowar/craft-3-adminbar/blob/master/src/services/EditLinks.php#L48,  but this did not work for me.

But when I call the predefined service from the pluginfactory: FacebookPageConnector::$plugin-&gt;facebookPageConnectorService-&gt;exampleService(),  it works fine .

here images with my code
In your plugin's composer.json, add the service to extra.components to make it available on the plugin instance. You should see the predefined service already listed there.

You might need to empty the vendor folder of your craft website and reinstall your composer dependencies as Craft appears to cache this information.