GithubHelp home page GithubHelp logo

Comments (4)

twinssbc avatar twinssbc commented on July 29, 2024 1

@ravindranpandu It's not set directly in the directive, you need to assign it to a scope variable and set it in the controller.

from ionic-calendar.

ravindranpandu avatar ravindranpandu commented on July 29, 2024

@twinssbc it works now thanks, i have a weird issue now, when the range is changed the range-changed="" event is fired but the values are not updated in the calendar.

$scope.$parent.$watch($attrs.eventSource, function (value) { self.onEventSourceChanged(value); });

when i add debugger to the watch code, it only triggers for the first time, after range-change when i try to reassign the new values to the $scope.eventSource the $watch is not triggered hence the calendar is loaded with empty events, am i missing something?

For your reference i am attaching my code below

code.zip

from ionic-calendar.

twinssbc avatar twinssbc commented on July 29, 2024

@ravindranpandu Does Events.all() always return the same object reference?
As I mentioned in the README, if you only modify the element in the eventSource array, the controller won't get notified. You need to manually broadcast the 'eventSourceChanged' event.

Note In the current version, the calendar controller only watches for the eventSource reference as it's the least expensive. That means only you manually reassign the eventSource value, the controller get notified, and this is usually fit to the scenario when the range is changed, you load a new data set from the backend. In case you want to manually insert/remove/update the element in the eventSource array, you can call broadcast the 'eventSourceChanged' event to notify the controller manually.

from ionic-calendar.

ravindranpandu avatar ravindranpandu commented on July 29, 2024

@twinssbc it works!!, thank you so much, as you guessed i am modifying the element in the eventSource array thats why the calendar is not updated with new events. calling the eventSourceChanged broadcast solves my problem :)

from ionic-calendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.