-
-
Save karkranikhil/0af54c9e659e0c1fa373 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myApp = angular.module('myApp',[]); | |
| myApp.controller('TestCtrl', ['$scope', function($scope) { | |
| $scope.jobs = [{ title: 'First', description : 'Something' }, | |
| { title: 'Second', description : 'Another thing' }]; | |
| $scope.state = { selected: undefined }; | |
| $scope.toggle = function(index) { | |
| $scope.state.selected = ($scope.state.selected != index ? index : undefined); | |
| } | |
| }]); | |
| <div class="col span_2_of_3" ng-controller="TestCtrl"> | |
| <div ng-repeat="item in jobs"> | |
| <accordion> | |
| <accordion-group ng-click="toggle($index)"> | |
| <accordion-heading> | |
| <h2> | |
| "{{item.title}}" | |
| <i class="pull-right glyphicon " | |
| ng-class="{'glyphicon-chevron-up': $index == state.selected, | |
| 'glyphicon-chevron-down': $index != state.selected }"></i> | |
| </h2> | |
| </accordion-heading> | |
| {{item.description}} | |
| </accordion-group> | |
| </accordion> | |
| </div> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment