Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. var users = [
  2. { id: 1, firstName: 'John', lastName: 'Doe' },
  3. { id: 2, firstName: 'Jane', lastName: 'Doe' },
  4. { id: 3, firstName: 'Bob', lastName: 'Turner' }
  5. ];
  6.  
  7. <ol class="nya-bs-select" ng-model="user">
  8. <li nya-bs-option="option in users track by option.id">
  9. <a>
  10. <span>{{option.firstName}}</span>
  11. <span class="glyphicon glyphicon-ok check-mark"></span>
  12. </a>
  13. </li>
  14. </ol>
  15.  
  16. Selected User: {{user | json}}
  17.  
  18. <ol class="nya-bs-select" ng-model="userId">
  19. <li nya-bs-option="option in users" data-value="option.id">
  20. <a>
  21. <span>{{option.firstName}}</span>
  22. <span class="glyphicon glyphicon-ok check-mark"></span>
  23. </a>
  24. </li>
  25. </ol>
  26.  
  27. <!-- user object is not available here, we only have userId -->
  28. Selected User: {{user | json}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement