Skip to content

Commit

Permalink
Update extensions docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed May 22, 2020
1 parent ee99293 commit 73c60c3
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,20 @@ For example:
The approach for all of these is the same:

1. Create a new component that will provide the tab contents
2. Ensure that your component is included in the `EntryComponent` section of your custom module
2. Ensure that your component is declared with the `ExtensionService` in the imports of your custom module, for example:
```
@NgModule({
imports: [
ExtensionService.declare([
ExtensionComponent,
])
],
declarations: [
ExtensionComponent
]
})
```

2. Decorate the component with the `StratosTab` decorator, for example:

```
Expand Down Expand Up @@ -122,8 +135,8 @@ An action is a icon button that appears at the top-right of a View. For example:
The approach for all of these is the same:

1. Create a new component that will provide the contents to show when the action is clicked
2. Ensure that your component is included in the `EntryComponent` section of your custom module
2. Decorate the component with the `StratosAction` decorator, for example:
2. Ensure that your component is declared with the `ExtensionService` in the imports of your custom module
3. Decorate the component with the `StratosAction` decorator, for example:

```
@StratosAction({
Expand Down Expand Up @@ -243,16 +256,19 @@ export class ExampleTabExtensionComponent implements OnInit {
Save the file.


### Mark the component as an entry component
### Mark the component as an extensions component

The last thing we need to do is to mark our Extension component as an entry component.
The last thing we need to do is to mark our Extension component as an extensions component.

To do this, in a text editor, open the file `src/frontend/app/custom/custom.module.ts` and add the entry components section so it looks like this:
To do this, in a text editor, open the file `src/frontend/app/custom/custom.module.ts` and add the `ExtensionService.declare` to the import sesion, so it looks like this:

```
@NgModule({
imports: [
CommonModule
CommonModule,
ExtensionService.declare([
ExampleTabExtensionComponent,
])
],
declarations: [ExampleTabExtensionComponent],
entryComponents: [ExampleTabExtensionComponent]
Expand Down

0 comments on commit 73c60c3

Please sign in to comment.