|
@@ -20,6 +20,8 @@ class MyService extends BaseService {
|
|
|
return `Welcome to ${product.title}!`
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+export default MyService;
|
|
|
```
|
|
|
|
|
|
The first argument to the `constructor` is the global giving you access to easy dependency injection. The container holds all registered services from the core, installed plugins and from other files in the `/services` directory. The registration name is a camelCased version of the file name with the type appended i.e.: `my.js` is registered as `myService`, `custom-thing.js` is registerd as `customThingService`.
|
|
@@ -39,5 +41,7 @@ export default () => {
|
|
|
message: await myService.getProductMessage()
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
+ return router;
|
|
|
}
|
|
|
```
|