Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The template files that the plug-in provides are what will be turned into the source of the forms components. As each framework defines its components in a different way, template files will be different for every framework, perhaps even for every framework version.

The template files from a plug-in are copied out of the plug-in folder and into the templates folder specified during the Forms CLI project initialisation. This is so that the developers can modify these templates individually.

Sample Angular Template

Code Block
languagejs
<ng-form name="<%interaction%>" class="bm-form" <%#showWhen%>ng-show="<%moduleName%>.<%showWhen%>()"<%/showWhen%>
                  <%#hideWhen%>ng-hide="<%moduleName%>.<%hideWhen%>()"<%/hideWhen%>>
  <%&header%>
  <%&elements%>
  <%&footer%>

  <ng-transclude ng-transclude-slot="pagination"></ng-transclude>
  <button ng-click="<%moduleName%>.onSaveClick(<%moduleName%>.model)" ng-show="!<%moduleName%>.isSubForm">Submit</button>
</ng-form>

...

The next section will go into detail on what functionality the Template Helper Module provides.

Next Step

Using the Template Helper Module