Skip to content
This repository has been archived by the owner on May 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #19 from senzil/master
Browse files Browse the repository at this point in the history
wait for DOM is ready and jqcloud's div's style was calculated
  • Loading branch information
mistic100 committed Aug 21, 2016
2 parents b62ab14 + 9f8b422 commit 58db9ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
.idea
bower_components
node_modules
22 changes: 13 additions & 9 deletions angular-jqcloud.js
Expand Up @@ -39,18 +39,22 @@ angular.module('angular-jqcloud', []).directive('jqcloud', ['$parse', function($
options.afterCloudRender = $scope.afterCloudRender;
}

jQuery($elem).jQCloud($scope.words, options);
angular.element(document).ready(function() {

$scope.$watchCollection('words', function() {
$scope.$evalAsync(function() {
var words = [];
$.extend(words,$scope.words);
jQuery($elem).jQCloud('update', words);
jQuery($elem).jQCloud($scope.words, options);

$scope.$watchCollection('words', function() {
$scope.$evalAsync(function() {
var words = [];
$.extend(words,$scope.words);
jQuery($elem).jQCloud('update', words);
});
});

$elem.bind('$destroy', function() {
jQuery($elem).jQCloud('destroy');
});
});

$elem.bind('$destroy', function() {
jQuery($elem).jQCloud('destroy');
});
}
};
Expand Down

0 comments on commit 58db9ac

Please sign in to comment.