Coder Social home page Coder Social logo

Comments (4)

amirnissim avatar amirnissim commented on May 3, 2024

created Events service with dashboardchange event [c53f965]

from redash.

alonho avatar alonho commented on May 3, 2024

I think the suggested solution with an event isn't bad. The other options I can think of:

  1. Pass a callback into the directive to be fired upon change: on-change="reloadDashboards()".
  2. Trigger the modal from javascript and not html and reload the dashboards upon close of the modal.

from redash.

arikfr avatar arikfr commented on May 3, 2024

Any solution for this problem that relies on communication in the view layer will probably lead to maintenance hell.

It's better to have a "single source of truth" and have the views represent its state. When it mutates, mutate the view. Angular makes it easy, as this is its default behavior - you just need to wire things right.

In this case, I would have a dashboards model. This model holds the list of all dashboards, recent dashboards, etc. And it gets notified when you edit/create/delete a dashboard. And for simplicity, there is no need to have an identity map or similar - just notify it, and reload from the whole list(s) from the server.

from redash.

arikfr avatar arikfr commented on May 3, 2024

I ended up using an event :-\ Binding the list in the template to a function on a service isn't straightforward and introduced its own set of issues. In the spirit of "done is better than perfect", just used an event...

from redash.

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.