Defining a View with Sub-views in Multiple XHTML Files
1. Create the <file_name>.xhtml under the views directory.
2. Use data-ng-include attribute to tie up with the parent view.
If you have created view1.xhtml and view2.xhtml, edit view.xhtml as shown below.
<div data-ng-include="/<CONTEXT_ROOT_OF_APPLICATION/<GADGETS_DIRECTORY>
/views/view1.xhtml">
</div>
<div data-ng-include="/<CONTEXT_ROOT_OF_APPLICATION/<GADGETS_DIRECTORY>
/views/view2.xhtml">
</div>
Replace <CONTEXT_ROOT_OF_APPLICATION> and <GADGETS_DIRECTORY> accordingly. All views specified under the view.xhtml are automatically bound to the controller.
Note: You can use the data-ng-model or data-ng-bind attributes to setup two-way binding to the controller scope variables.