Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created August 1, 2014 18:03
Show Gist options
  • Save karlwestin/fdfb41cb98ee89b0d4d7 to your computer and use it in GitHub Desktop.
Save karlwestin/fdfb41cb98ee89b0d4d7 to your computer and use it in GitHub Desktop.
>
<div class="block-item"
ng-repeat="field in institution.login | filter:notOptional ">
<div class="rfz-view" ng-switch="field.type">
<input class="full"
ng-switch-when="text"
type="text"
placeholder="{{field.label}}"
name="{{field.key}}" />
<input class="full"
ng-switch-when="password"
type="password"
placeholder="{{field.label}}"
name="{{field.key}}" />
<select ng-switch-when="select"
name="{{field.key}}">
<option ng-repeat="option in field.values" value="{{option.value}}">
{{option.label}}
</option>
</select>
</div>
</div>
<a href="" ng-show="!showOptional" rfz-tap="showOptional=true">Show optional fields</a>
<a href="" ng-show="showOptional" rfz-tap="showOptional=false">Hide optional fields</a>
<div class="block-item"
ng-repeat="field in institution.login | filter:isOptional "
ng-hide="!showOptional">
<div class="rfz-view" ng-switch="field.type">
<input class="full"
ng-switch-when="text"
type="text"
placeholder="{{field.label}}"
name="{{field.key}}" />
<input class="full"
ng-switch-when="password"
type="password"
placeholder="{{field.label}}"
name="{{field.key}}" />
<select ng-switch-when="select"
name="{{field.key}}">
<option ng-repeat="option in field.values" value="{{option.value}}">
{{option.label}}
</option>
</select>
<div ng-switch-default>Unkown type: {{field.type}}</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment