Comments (6)
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.
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.
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.
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.
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.
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)
- Size limitation on very long grid (the limit is different depending on the browser) HOT 2
- Unable to clone the demo HOT 1
- Unable to clone demo HOT 1
- Gridster module error
- DragEnd event not fired when in iFrame (Chrome browser)
- Maintainer Needed. Please apply HOT 2
- Publish latest version in npm (0.13.15) HOT 1
- Overlap of widgets when max rows is set
- auto resize content of a grid
- angular.resize issue HOT 2
- wrong rowHeight ratio
- JQUERY Gridster Widgets Overlap Issue HOT 1
- Print page-breaks don't work
- fix container of gridster HOT 1
- How to link $scope between widgets
- angular 7 can use? HOT 1
- maxTop in 'angular-gridster/src/angular-gridster.js'
- Is there a way to change 4 corners of an item?
- create "white spaces" while dragging
- Attempting to add a new element and there is no armed behind it fails even though there is a space before it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-gridster.