Skip to content

Commit 8900e49

Browse files
committed
fix: don't compile text nodes in the directive
Fixes #168
1 parent 6733616 commit 8900e49

11 files changed

Lines changed: 38 additions & 11 deletions

dist/modules/ocLazyLoad.directive.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
}, function (moduleName) {
1919
if (angular.isDefined(moduleName)) {
2020
$ocLazyLoad.load(moduleName).then(function () {
21-
$animate.enter($compile(content)($scope), $element);
21+
$animate.enter(content, $element);
22+
var contents = element.contents();
23+
angular.forEach(contents, function (content) {
24+
if (content.nodeType !== 3) {
25+
// 3 is a text node
26+
$compile(content)($scope);
27+
}
28+
});
2229
});
2330
}
2431
}, true);

dist/ocLazyLoad.js

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

dist/ocLazyLoad.js.map

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

dist/ocLazyLoad.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.

dist/ocLazyLoad.min.js.map

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

dist/ocLazyLoad.require.js

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

dist/ocLazyLoad.require.js.map

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

dist/ocLazyLoad.require.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.

dist/ocLazyLoad.require.min.js.map

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/complexExample/partials/main.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h3>Autoload a complete module with dependencies and templates using the directi
1414

1515
<!-- gridModule has been defined in the app config -->
1616
<div oc-lazy-load="gridModule">
17-
<div ng-controller="GridModuleCtrl">
17+
<div ng-controller="GridModuleCtrl">
1818
<span>{{test}}</span><br/>
1919
<div ui-grid="gridOptions" class="gridStyle"></div>
2020
</div>

0 commit comments

Comments
 (0)