-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for unpacking packery object and emit packery instance with its hash. #34
Comments
Hi buddy, I've create a pull request for these fix: |
We certainly have a need for unpacking / destroying individual objects. Thanks for your help on that. As for the second part, the emitted "packeryInstantiated" event was used in an earlier build, but was left in after a rewrite in order to provide the Packery object, as you have identified. The Packery object is also attached to each Packery container element and can be referenced via I'm not sure I understand the need for being able to pass in a unique ID via an attribute? A simple ID attribute can be added to the main Packery element and should transclude, allowing you to uniquely identify each instance within your app and access via the data method. |
angular.element('whatevercontainer').data('Packery') is the directly DOM operation, which is also not suggested to be used in controller directly, however in the most cases, we need do call packery.layout on a controller after a data binding occurs, so we hold the instance via $scope should be more reasonable. |
You mention: 'The Packery object is also attached to each Packery container element and can be referenced via angular.element('whatevercontainer').data('Packery')'. However, I can't seem to get this to work. In my controller I do: var logme = angular.element('#packeryContainer').data('Packery'); #packeryContainer is the ID of my packery container div (the div with attribute 'packery' on it). I get back an object of the element but I can't find Packery anywhere within it. Any ideas? |
@rhclayto I was encountering the same issue and fixed it by wrapping everything in a $timeout:
|
Firstly, It's a great angular module which can fulfill the packery packing functions in angular fashion.
However, when using this module, I find some defects:
The text was updated successfully, but these errors were encountered: