Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using angular ui drop down element

<div class="dropdown" >
          <a  ng-click="getTypes();" dropdown-toggle>  Add a Type</a>
             <ul class="dropdown-menu">
                <li ng-repeat="type in Types"><a><b>{{type.sType }}:</b><em>{{type.sDescription}}</em></a> </li>
             </ul>
        </div>

all that i do is call a web service and populate Types all works fine! But when i add the above code in my htm the div below it starts throwing the exception of max digest reached.

the div below the drop down code(as written above) simply consists of few editable segments with icons and their visibility is controlled by ng-show and ng-hide when the use click a button

say on click of 1st segment i set a variable to true by using ng-click and depending on this variable i show or hide segments by using ng-show and ng-hide

so my doubt is that without the drop down code written above my ng-show and ng-hide work completely fine but the moment i try to use the drop down directive of angular ui i start getting this exception when i click on the buttons . please help.

Edit below is the code which follows basically user clicks on icons to reorder the elements that are appearing in the ng-repeat list and from the drop down which is above the user can add elements to this list

<ul class="repeatList text-center">
                <li ng-repeat="widgets in leftWidgets" widget widgets="widgets" 
                    class="wArea">
                    <a href="" class="icon-remove-circle pull-right" ng-show="editMode" ng-click="deleteWidget(leftWidgets);"
                        title="Delete Widget">
                    </a>
                    <a href="" class="icon-chevron-up slideUpIcon" ng-click="shiftUp(widgets,leftWidgets);"
                        ng-show="editMode">
                    </a >
                    <a href="" class="icon-chevron-down slideDownIcon" ng-click="shiftDown(widgets,leftWidgets);"
                        ng-show="editMode">
                    </a>
                </li>
            </ul>
share|improve this question
 
please provide more code, from what you posted I think can't find the issue. You can use this template in Fiddle: jsfiddle.net/9Ymvt/878 –  Maxim Shoustin 20 hours ago
 
This issue is the "infinite loop" of angularJS. Somehow angularJS loops into the controller over and over, but as said above pieces of code are missing here. –  dabee 16 hours ago
 
Nice post on the issue i read the above post and kept doing hit and trial and found that using empty anchor tags was causing the problem. i.e. i had attached ng-click events to <a href="" ng-click="handler();"> text </a> tags the moment i changed them to span all worked fine! –  Rishul Matta 2 hours ago
 
thanks @MaximShoustin for the fiddle it assured me that nothing is wrong in the above code –  Rishul Matta 2 hours ago
add comment

1 Answer

kept doing hit and trial and found that using empty anchor tags was causing the problem. i.e. i had attached ng-click events to

<a href="" ng-click="handler();"> text </a>   //empty href

the moment i changed them to span all worked fine! dont know why the empty "a" tags caused the problem but it will be great if any one can shed some light on the reasons for the above run time angular js exception. the link below is a useful

How to Troubleshoot Angular "10 $digest() iterations reached" Error

thanks!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.