With more complex plugins, you may find a need for multiple pages. The plugin editor provides just one HTML setting, but it can be used to define multiple AngularJS script templates. The initial plugin HTML will start with one template, similar to the following.
You can add additional templates, as seen below. Note that you need to use a dash-delimited version of your namespace as a prefix to your template IDs. Ex:
my-plugin. This is used for consistency with the AngularJS HTML attribute format.
The main plugin template will need a way to toggle the other templates. This can be achieved using an
ng-include. Here we will use an expression to append a dynamic value called
This example uses
ng-include to display the template inline, but you can also display templates as a modal using the modal factory.
$routeParams dependency is needed to read the params. We also need to add the additional route param to the plugin registration under
For this example, the main plugin route would be similar to
The additional route set on the first
interfaces object for templates with a dynamic
page param would be accessible by
On the second
interfaces object also an additional route is set for templates with a dynamic
config param that would be accessible by