Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var users = [
- { id: 1, firstName: 'John', lastName: 'Doe' },
- { id: 2, firstName: 'Jane', lastName: 'Doe' },
- { id: 3, firstName: 'Bob', lastName: 'Turner' }
- ];
- <ol class="nya-bs-select" ng-model="user">
- <li nya-bs-option="option in users track by option.id">
- <a>
- <span>{{option.firstName}}</span>
- <span class="glyphicon glyphicon-ok check-mark"></span>
- </a>
- </li>
- </ol>
- Selected User: {{user | json}}
- <ol class="nya-bs-select" ng-model="userId">
- <li nya-bs-option="option in users" data-value="option.id">
- <a>
- <span>{{option.firstName}}</span>
- <span class="glyphicon glyphicon-ok check-mark"></span>
- </a>
- </li>
- </ol>
- <!-- user object is not available here, we only have userId -->
- Selected User: {{user | json}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement