angularjs - AngularUI - Accordion trigger a method inside the template using ng-click -
i'm using angularui bootstrap library templates. i'm wainting call custom method inside template , wondering need in order working? guess i'm wanting replace ng-click="isopen = !isopen" own custom method if possible.
thanks in advance.
<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel- title">\n <a class="accordion-toggle" ng-click="isopen = !isopen" accordion- transclude="heading">{{heading}}</a>\n </h4>\n </div>\n <div class="panel-collapse" collapse="!isopen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>
since clicking on toggle changes value of isopen
, can watch , apply logic without changing ng-click
attribute
$scope.$watch('isopen', function(value) { if (value) { // code } });
Comments
Post a Comment