app/views/partials/html_view_single.html
{{#fields}}
{{#if showInFormView}}
<div class="form-group" ng-class="{'has-error': TopPageForm.{{name}}.$invalid}">
{{#fieldType fieldType 'text'}}
<label class="control-label" for="{{../../../model.name}}-{{name}}">{{label}}</label>
<input type="text" class="form-control" id="{{../../../model.name}}-{{name}}" name="{{name}}"
data-ng-model="current.instances.{{../../../model.name}}.data.{{name}}"
ng-change="rowChanged(current.instances.{{../../../model.name}})"
{{#if blurFunction}}ng-blur="{{blurFunction}}"{{/if}}
{{#if placeholder}}placeholder="{{placeholder}}"{{/if}}
{{#if required}}ng-required="current.instances.{{../../../../model.name}}"{{/if}}
{{#if disabled}}disabled{{/if}}
{{#if help}}aria-describedby="help-{{../../../../model.name}}-{{name}}"{{/if}}
>
{{#links}}<a href="" data-ng-click="link('{{page}}', '{{filter}}', '{{../../../../model.name}}')">{{title}}</a>{{/links}}
{{#if help}}<span id="help-{{../../../model.name}}-{{name}}" class="help-block">{{help}}</span>{{/if}}
{{/fieldType}}
{{#fieldType fieldType 'select'}}
<label class="control-label" for="{{../../../model.name}}-{{fieldName}}">{{label}}</label>
<ui-select
current="current.instances.{{../../../model.name}}.data"
item-model="{{select.model}}"
item-value="{{select.sourceValue}}"
item-where="{{json select.where}}"
instance-model="{{../../../model.name}}"
instance-key="{{select.targetID}}"
instance-value="{{fieldName}}"
other-mappings="{{json this.select.otherMappings}}"
></ui-select>
{{/fieldType}}
{{#fieldType fieldType 'checkbox'}}
<div class="checkbox">
<label class="control-label" class="ui-checkbox" for="{{../../../model.name}}-{{fieldName}}">
<input type="checkbox" id="{{../../../model.name}}-{{fieldName}}"
data-ng-model="current.instances.{{../../../model.name}}.data.{{fieldName}}"
ng-change="rowChanged(current.instances.{{../../../model.name}}, '{{fieldName}}')">
{{label}}
</label>
</div>
{{/fieldType}}
</div>
{{/if}}
{{/fields}}