I'm trying to detect if my accordion is clicked when user click the accordion.
I found this post: Handle open/collapse events of Accordion in Angular, but my markup is like:
<accordion id='accordion' close-others="false">
<accordion-group is-open="false">
<accordion-heading>
title
</accordion-heading>
<div>
<div>
Cat ipsum dolor sit amet, find something else more interesting all of a sudden go crazy,
</div>
</div>
</accordion-group>
<accordion-group is-open="false">
<accordion-heading>
title 2
</accordion-heading>
<div>
<div>
second contents.
</div>
</div>
</accordion-group>
</accordion>
My controller:
.controller('Ctrl', ['$scope', function ($scope) {
//I want to detect if the user click the accordion based on the is-open attribute.
console.log($scope.is-open) //it doesn't return anything..
}]);
How do I do this?