Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

toggle button in angularjs bootstrap

<a class="btn pull-right" 
   ng-class="{true: 'btn-primary', false: 'btn-danger'}[!patient.archived]"
   ng-click="patient.archived = !patient.archived">
  {{!patient.archived && 'Archive' || 'Unarchive'}} patient
</a>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #toggle #button #angularjs #bootstrap
ADD COMMENT
Topic
Name
5+4 =