rpocklin/angular-timeline

Error on $scope data changing

MadEddieFFS opened this issue · 8 comments

Hi,

When the data which the timeline is rendering is changed I get

Error: d[h].apply is not a function hf/this.$get</m.prototype.$broadcast@http://localhost:9885/Scripts/angular.min.js:136:426 hf/this.$get</m.prototype.$destroy@http://localhost:9885/Scripts/angular.min.js:132:362 Ce</<.compile/</<@http://localhost:9885/Scripts/angular.min.js:277:203 hf/this.$get</m.prototype.$watchCollection/<@http://localhost:9885/Scripts/angular.min.js:130:291 hf/this.$get</m.prototype.$digest@http://localhost:9885/Scripts/angular.min.js:131:354 hf/this.$get</m.prototype.$apply@http://localhost:9885/Scripts/angular.min.js:134:359 l@http://localhost:9885/Scripts/angular.min.js:86:325 M@http://localhost:9885/Scripts/angular.min.js:90:370 Rf/</x.onload@http://localhost:9885/Scripts/angular.min.js:91:394

I am simply calling (simplified for brevity)
$scope.timelineData = TimelineData.query()

Thanks for pointing this out. It may be bug in angular-scroll-animate, which this uses in the example only. Feel free to strip it out, but I created that plugin, so i'll fix it an release a new version ASAP.

Bumped angular-scroll-animate with new version of angular-timeline v1.5.1.

If the problem still occurs, please re-open.

Sorry - have updated the versions to 1.5.1 but the problem still occurs

Can you give me a plunkr to demo the issue? I need to understand if it is the directive, how it is being used or something else.

http://plnkr.co/edit/Hc7Q40STgUfAusjzMHY9?p=preview

Although this exhibits different behaviour to what I described. The new timeline events are not being rendered (because they are being added to the DOM with the "hidden" class). I can't see why they are not being shown but in theory this will lead on to show you what I described previously

Yep, sorry - I naively assumed angular / JQ-Lite supported event namespacing. It doesn't :(
I've fixed the issue (again in angular-scroll-animate) so just install v1.5.2 of this plugin.

Here's a working version of your plunkr:
http://plnkr.co/edit/BoC7Kb8QoGXmE6XW1c6n?p=preview

Let me know if you have any more issues.

The refresh now works perfectly which is what I needed :) I would note though that performing the push function on the events array seems to correctly add them to the timeline DOM but there is no way of getting them to actually show.

Great.

re: no way to get them to show - i'm not sure what you mean - when I click the button 'Add to Timeline' on the last plunkr it appends the elements to the DOM (auto-shows them if they are inside the current viewport) and scrolling up / down shows and hides them accordingly. Can you explain the problem further?