-2

This is not an interpolation issue. I removed any interpolation in my code and I am still getting the same error.

I am getting this error when when clicking on an ng-click that points to a page reference defined as a .state in app.js. What does this error mean? I can’t find any reference to it via a google search, specifically nextEvent

   // app.js
  .state('tab.clubs', {
      cache: false,
      url: '/clubs',
      views: {
        'tab-clubs': {
          templateUrl: 'templates/tab-clubs.html',
          controller: 'ClubCtrl'
        }
      }
    })
    .state('tab.club-detail', {
      url: '/clubs/:clubID',
      views: {
        'tab-clubs': {
          templateUrl: 'templates/detail-clubs.html',
          controller: 'ClubDetailCtrl'
        }
      }
    })

And the call in my template. NOTE, there is an ng-repeat nested inside another ng-repeat - however I don't think this is causing the problem because everything renders properly with the expected IDs and indexes....and the error ONLY generates when I click on the the <div ng-click="...."> that is inside the nested ng-repeat:

  <div id="club_tabItem_{{club.data[0].clID}}" style="padding:5px;border-bottom:1px solid grey;" class="item-remove-animate item-avatar" ng-repeat="club in clubs">
    <div id="loc_{{club.data[0].clID}}" style="left:15px;">
      <div ng-click="showEvents(club.data[0].clID);">
        <h3>{{club.data[0].clVendor}}
          <!-- <span style="margin-left:15px;">Location: {{club.data[0].clAddress1}}, {{club.data[0].clCity}}</span> -->
          <i style="font-size:25px;float:right;" class="icon ion-android-arrow-dropdown-circle icon-accessory customColor1"></i>
        </h3> 
        <span style="padding-left:30px;">{{club.data[0].clDesc}}</span>
      </div>
      <div id="eventsDiv_{{club.data[0].clID}}" style="width:100%;display:none;margin-top:10px;background-color:lightGrey;">
        <div id="events_{{event.ceID}}" style="width:80%;margin-left:20%;display:inline-block;" ng-repeat="event in club.events">
          <div ng-click="$location.url('/tab/clubs/' + event.ceID)" >
             <div style="float:left;font-size:14px;font-weight:bolder;">{{event.ceName}} ({{event.ceName1}}) </div>
             <div style="float:left;margin-left:15px;">Location: {{club.data[0].clAddress1}}, {{club.data[0].clCity}}</div> 
             <div style="float:left;margin-left:15px;">Next: {{nextEvent(event)}}</div>
              <i style="font-size:25px;" class="icon ion-android-arrow-dropright-circle icon-accessory customColor1"></i>
          </div>
        </div>
      </div>
    </div>
  </div>

In the above case, the call is: ng-click="$location.url('/tab/clubs/1')" - in the controller I have $scope.$location = $location with $location being passed into the controller properly.

As best I can tell, debugging doesn't even make it to the controller of the .state detail-clubs page. The error fires before entering the controller.

More on the error:

ionic.bundle.js:20306 Error: [$parse:ueoe] Unexpected end of expression: nextEvent(club.event[club.eIndex]
http://errors.angularjs.org/1.3.13/$parse/ueoe?p0=nextEvent(club.event%5Bclub.eIndex%5D
    at ionic.bundle.js:8762
    at Parser.consume (ionic.bundle.js:20747)
    at Parser.functionCall (ionic.bundle.js:21022)
    at Parser.primary (ionic.bundle.js:20694)
    at Parser.unary (ionic.bundle.js:20970)
    at Parser.multiplicative (ionic.bundle.js:20953)
    at Parser.additive (ionic.bundle.js:20944)
    at Parser.relational (ionic.bundle.js:20935)
    at Parser.equality (ionic.bundle.js:20926)
    at Parser.logicalAND (ionic.bundle.js:20917)
(anonymous) @ ionic.bundle.js:20306
(anonymous) @ ionic.bundle.js:17256
$broadcast @ ionic.bundle.js:23421
(anonymous) @ ionic.bundle.js:40889
processQueue @ ionic.bundle.js:21888
(anonymous) @ ionic.bundle.js:21904
$eval @ ionic.bundle.js:23100
$digest @ ionic.bundle.js:22916
$apply @ ionic.bundle.js:23205
(anonymous) @ ionic.bundle.js:20063
eventHandler @ ionic.bundle.js:11713
triggerMouseEvent @ ionic.bundle.js:2863
tapClick @ ionic.bundle.js:2852
tapTouchEnd @ ionic.bundle.js:2975
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
rolinger
  • 2,787
  • 1
  • 31
  • 53
  • Please include the complete text and stack trace of the error message. – georgeawg Nov 16 '18 at 18:15
  • @georgeawg - added the full error message – rolinger Nov 16 '18 at 18:19
  • The `ng-click` expression looks sketchy. It mixes AngularJS expressions with interpolation. – georgeawg Nov 16 '18 at 18:30
  • **Divide and conquer.** When you have a small amount of code, but the source of the problem is entirely unclear, start removing code a bit at a time until the problem disappears – then add the last part back. See also [AngularJS Error Reference - $PARSE UEOE](https://code.angularjs.org/1.3.13/docs/error/$parse/ueoe?p0=nextEvent(club.event%5Bclub.eIndex%5D)) – georgeawg Nov 16 '18 at 18:31
  • @georgeawg - I have done that. The error happens when I click on the ng-click DIV in the app. As well, I use that same `ng-click="$location.url(....)"` at other locations in my code with no issue. If I remove the ng-click and change the parent div with the ng-repeat to an `` I get the same error when I click on the element. – rolinger Nov 16 '18 at 18:36
  • According to this https://code.angularjs.org/1.3.13/docs/error/$parse/ueoe?p0=nextEvent(club.event%5Bclub.eIndex%5D the error implies I have an open ended expression, missing a bracket or something. But I don't see it. – rolinger Nov 16 '18 at 18:42
  • @georgeawg - I removed interpolation issues and am still getting the same error. – rolinger Nov 16 '18 at 20:31
  • 1
    Maybe the dupe here really is wrong, but I am voting to *Leave Closed* for the lack of an MCVE. I don't see anything stopping you from trimming this down to a minimal example that reproduces the error, but you haven't done so; instead this example manages to be at once incomplete (we can't copy and paste it and run it because the template depends upon `$scope` variables like `club`) and much longer than necessary. (I bet you don't need half that HTML to reproduce the error; you *surely* don't need all the classes and inline styles that push the lines off the side of the code block.) – Mark Amery Nov 17 '18 at 11:10

1 Answers1

-1

Don't mix AngularJS expressions and interpolation:

<div id="events_{{event.ceID}}" style="width:80%;margin-left:20%;display:inline-block;" ng-repeat="event in club.events">
    ̶<̶d̶i̶v̶ ̶n̶g̶-̶c̶l̶i̶c̶k̶=̶"̶$̶l̶o̶c̶a̶t̶i̶o̶n̶.̶u̶r̶l̶(̶'̶/̶t̶a̶b̶/̶c̶l̶u̶b̶s̶/̶{̶{̶e̶v̶e̶n̶t̶.̶c̶e̶I̶D̶}̶}̶'̶)̶"̶>̶
    <div ng-click="$location.url('/tab/clubs/'+event.ceID)">
       <div style="float:left;font-size:14px;font-weight:bolder;">{{event.ceName}} ({{event.ceName1}}) </div>
       <div style="float:left;margin-left:15px;">Location: {{club.data[0].clAddress1}}, {{club.data[0].clCity}}</div> 
       <div style="float:left;margin-left:15px;">Next: {{nextEvent(event)}}</div>
        <i style="font-size:25px;" class="icon ion-android-arrow-dropright-circle icon-accessory customColor1"></i>
    </div>
</div>

For more information, see Why mixing interpolation and expressions is bad practice.

georgeawg
  • 48,608
  • 13
  • 72
  • 95
  • thanks for the read. I changed the code to reflect your edit and I am still getting the same error. Now I am looking for an open ended expression...I am looking further and further up in the code to see where it could be coming from but not finding anything. – rolinger Nov 16 '18 at 19:05
  • the problem has nothing to do with interpolation OR with the ng-repeat (as best I can tell)...I am calling a function `{{ nextEvent(event) }}` inside the nested ng-repeat and the error is being thrown on that function when the link is clicked. Still not certain why at the moment...but I kept focusing on the ng-repeat and the link itself. – rolinger Nov 16 '18 at 22:50
  • actually...nextEvent IS an angluarjs thing. I changed the name of my function and that same error is still calling when the link is clicked. I am thoroughly confused at this point – rolinger Nov 16 '18 at 23:38