Skip to content

Commit

Permalink
added check for footable() method present (in case of jQ Lite on angu…
Browse files Browse the repository at this point in the history
…lar element load jQuery on object)
  • Loading branch information
alexrayan committed Apr 30, 2016
1 parent d5c3422 commit 3c1134f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/angular-footable.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,18 @@ angular
tableOpts,
extractSpecOpts(tableOpts, attrs)
);

var tableObj = element.footable(tableOpts);

if(typeof element.footable === 'function'){
var tableObj = element.footable(tableOpts);
} else {
var tableObj = jQuery(element).footable(tableOpts);
}
bindEventHandler(tableObj, scope, attrs);
},1000);
scope.$watch(function() {return attrs.loadWhen; }, function(){
$timeout(function(){
element.trigger('footable_redraw');
scope.$watch(function() {return attrs.loadWhen; }, function(){
$timeout(function(){
element.trigger('footable_redraw');
});
});
});
},1000);
}
};
}]);

0 comments on commit 3c1134f

Please sign in to comment.