Skip to content

Commit 66eb3d8

Browse files
committed
fix(CoqModelDirective): temporary fix for CoqModel directive
Related #7
1 parent 24fabef commit 66eb3d8

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

dist/angular-coq.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ angular.module('coq').directive('coqModel', [
313313
'$compile',
314314
function ($compile) {
315315
return {
316-
priority: 102,
316+
terminal: true,
317317
controller: 'coqModelController',
318318
restrict: 'A',
319319
link: {
@@ -336,14 +336,10 @@ angular.module('coq').directive('coqModel', [
336336
}
337337
$compile(element.contents())(scope);
338338
paragraphs = null;
339-
} else {
340-
element.addClass('coq-clean');
341339
}
342340
},
343341
post: function (scope, iElement) {
344-
if (!$(iElement).hasClass('coq-clean')) {
345-
$compile(iElement.contents())(scope);
346-
}
342+
$compile(iElement.contents())(scope);
347343
}
348344
}
349345
};

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.

examples/directives.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ <h2>Edit a team</h2>
4444

4545
<h2>Create a team</h2>
4646

47-
<form coq-model="team2" ng-model="myForm" ng-submit="team2.save()">
47+
<form coq-model="team2" ng-model="myForm2" ng-submit="team2.save()">
4848
<p>Name : <input coq-model-attribute="name"></p>
4949

5050
<input type="submit">
51+
<a ng-click="team2.save()" href>click me</a>
5152
</form>
5253
</div>
5354
</body>

lib/directives/coq-model.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ angular.module('coq').controller('coqModelController', function($scope, $parse)
1111

1212
angular.module('coq').directive('coqModel', function($compile) {
1313
return {
14-
priority : 102,
14+
terminal : true,
1515
controller : 'coqModelController',
1616
restrict : 'A',
1717
link : {
@@ -36,14 +36,10 @@ angular.module('coq').directive('coqModel', function($compile) {
3636
}
3737
$compile(element.contents())(scope);
3838
paragraphs = null;
39-
} else {
40-
element.addClass('coq-clean');
4139
}
4240
},
4341
post : function (scope, iElement) {
44-
if (!$(iElement).hasClass('coq-clean')) {
45-
$compile(iElement.contents())(scope);
46-
}
42+
$compile(iElement.contents())(scope);
4743
}
4844
}
4945
};

0 commit comments

Comments
 (0)