Giter VIP home page Giter VIP logo

Comments (6)

danomatic avatar danomatic commented on May 28, 2024

In the .directive('gridster' directive object, we could probably add a controllerAs property that exposes the GridsterCtrl to the scope. There isn't a toJSON on the controller, but the .grid property allows access to it. I personally haven't needed to access the controller directly, due to the two-way binding of the scope items that Angular allows. Another approach is to replace/merge the gridster options object in the scope with the gridster controller instance. That's what the popular ng-grid directive does.

What do you think?

from angular-gridster.

intobrackets avatar intobrackets commented on May 28, 2024

Thanks for your reponse;
my problem is that i m not able to get grid properties from outside the directive.
sorry, may you show me code for this.

from angular-gridster.

smajl avatar smajl commented on May 28, 2024

Huh? You are supplying both gridster properties and items data yourself. They are two-way binded (always in sync). So where's the problem then? :) Just read the properties where you passed them into the directive (probably in your own controller).

from angular-gridster.

danomatic avatar danomatic commented on May 28, 2024

Yeah, it would help to have a more specific example of what you're trying to do in order to answer this.

from angular-gridster.

danomatic avatar danomatic commented on May 28, 2024

This comes down to understanding data binding in angular. This directive doesn't need to be used the same way the jQuery plugin was used.

from angular-gridster.

mconner avatar mconner commented on May 28, 2024

The issue I'm having is that while the data is bound, other information about the grid is not. I'd like access to the current width/height, current row width and column height. This information is in the controller.

from angular-gridster.

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.