https://plnkr.co/edit/7QscOzRc8mji7IwhccpZ?p=preview
I have an accordion. And I am using in each one the option of:
contenteditable=true
What I want to do, if the accordion has the property "contenteditable" assigned in true, then the ng-click executes the function:
ng-click="$event.stopPropagation();"
The previous line, inhibits that the accordion is open.
If contenteditable is false, then have the normal behavior. And the chord can be opened by clicking. I do not know how to accommodate this, in sight, to adjust the ng-if to my need.
<uib-accordion close-others="true">
<div ng-repeat="faq in faqs">
<div uib-accordion-group class="panel-default" is-open="faq.open">
<uib-accordion-heading >
<span contenteditable="true" data-directive ng-model='faq.pregunta' href="#" ng-click="$event.stopPropagation();">{{faq.pregunta}}</span> <i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': faq.open, 'glyphicon-chevron-right': !faq.open}"></i>
</uib-accordion-heading>
<span contenteditable="true" data-directive ng-model="faq.respuesta" ondrop='return false;'>{{faq.respuesta}}</span>
</div>
</div>
</uib-accordion>
thank you.
note: In the version of bootstrap that I have in the project, when clicking on the title of the accordion, the page is reloaded. I solved this by removing the "href" attribute from it, directly in the bootstrap library. In the github I put the modified bootstrap.js link, I do not know how to publish it or consume it from this page.