Skip to content

Commit ecb4558

Browse files
committed
check that jQuery is loaded before initializing froala
1 parent 80387ac commit ecb4558

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

demo/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
};
1212

1313
$scope.froalaAction = function(action){
14-
console.log('froalaAction', action);
1514
$scope.options.froala(action);
1615
};
1716

src/angular-froala.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ angular.module('froala', []).
1313
froala : '='
1414
},
1515
link: function(scope, element, attrs, ngModel) {
16+
if(!(element instanceof jQuery)){
17+
throw "Froala requires jQuery, are you loading it before Angular?";
18+
}
19+
1620
var defaultOptions = {};
1721
var contentChangedCallback;
1822
var options = angular.extend(defaultOptions, froalaConfig, scope.froala);

0 commit comments

Comments
 (0)