Skip to content

Commit 917470f

Browse files
committed
fix(coq-model): little hack to fix double-$compile issue with ng-click
Related #7
1 parent e009b9b commit 917470f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

dist/angular-coq.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,14 @@ angular.module('coq').directive('coqModel', [
283283
}
284284
$compile(element.contents())(scope);
285285
paragraphs = null;
286+
} else {
287+
element.addClass('coq-clean');
286288
}
287289
},
288290
post: function (scope, iElement) {
289-
$compile(iElement.contents())(scope);
291+
if (!$(iElement).hasClass('coq-clean')) {
292+
$compile(iElement.contents())(scope);
293+
}
290294
}
291295
}
292296
};

dist/angular-coq.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/directives/coq-model.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ angular.module('coq').directive('coqModel', function($compile) {
3636
}
3737
$compile(element.contents())(scope);
3838
paragraphs = null;
39+
} else {
40+
element.addClass('coq-clean');
3941
}
4042
},
4143
post : function (scope, iElement) {
42-
$compile(iElement.contents())(scope);
44+
if (!$(iElement).hasClass('coq-clean')) {
45+
$compile(iElement.contents())(scope);
46+
}
4347
}
4448
}
4549
};

0 commit comments

Comments
 (0)