Cannot read property 'then' of undefined

376 views
Skip to first unread message

Stefan Michalsky

unread,
Oct 31, 2014, 3:49:23 AM10/31/14
to ang...@googlegroups.com
Hey guys,

i have a problem with an ng-if. So first a snippet:

<div class="infoText">Posts in den letzten 24 Stunden<br>aus
   
<span ng-if="counts.profilesSelected !== counts.profiles">{{counts.profilesSelected}} von</span>
   
<span ng-bind="counts.profiles"></span> Profilen.
</div>

Rendering of that part work fine but if i switch the filter that changes the values in counts so all profiles are selected (eg. resulting in ng-if="100 !== 100") then chrome comes up with an TypeError:

TypeError: Cannot read property 'then' of undefined
    at
Object.ngIfWatchAction (http://127.0.0.1:9000/bower_components/angular/angular.js:23054:47)
    at
Object.applyFunction [as fn] (<anonymous>:778:50)
    at
Scope.$digest (http://127.0.0.1:9000/bower_components/angular/angular.js:13965:29)
    at
Scope.$delegate.__proto__.$digest (<anonymous>:844:31)
    at
Scope.$apply (http://127.0.0.1:9000/bower_components/angular/angular.js:14227:24)
    at
Scope.$delegate.__proto__.$apply (<anonymous>:855:30)
    at
HTMLTableCellElement.listener (http://127.0.0.1:9000/bower_components/ionic/release/js/ionic-angular.js:5076:15)
    at
Object.triggerEvent [as trigger] (http://127.0.0.1:9000/bower_components/ionic/release/js/ionic.js:770:15)
    at
Object.tapGesture [as handler] (http://127.0.0.1:9000/bower_components/ionic/release/js/ionic.js:1667:16)
    at
Object.detect (http://127.0.0.1:9000/bower_components/ionic/release/js/ionic.js:1348:30)

Does anyone know how i can fix this issue?

Cheers
Stefan

Sander Elias

unread,
Oct 31, 2014, 4:17:01 AM10/31/14
to ang...@googlegroups.com
Hi Stefan,

I can't really help you without seeing the code you use to change your `counts`. 
It looks like there is some promise stuff going on. 

It would help if you would a sample plunker, showing your problem in the simplest form possible.\

Regards
Sander


Stefan Michalsky

unread,
Nov 2, 2014, 1:29:53 PM11/2/14
to ang...@googlegroups.com
Hey Sander,

thanks for your reply. I found out that it was an issue with a dependency. I included the angular-caroussel but used a wrong version of angularjs.

Issue does not exist any more.

Cheers
Stefan

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/yfcLO5Q504w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages