-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to 1.0.0 breaks inline directive #194
Comments
I changed some things to the way directives are handled (to fix another bug). |
Just wrapped raw html string as an element. This addresses Issue ocombe#194.
For me, 532c7fe fixed the directive compiling issue. Thanks for the great tool:) |
@snkhrn commit on top of v1.0.5 did not work for me. Don't know why the $ocLazyLoad.load(moduleName).then(function success(moduleConfig) {
$animate.enter($compile(content)($scope), null, $element);
}); Into: $ocLazyLoad.load(moduleName).then(function () {
$animate.enter(content, $element);
var contents = element.contents();
angular.forEach(contents, function (content) {
if (content.nodeType !== 3) {
// 3 is a text node
$compile(content)($scope);
}
});
}); In this last version, Solution (is there really a need to skip text nodes?):
$animate.enter($compile(content)($scope), $element);
I would do a PR with solution 1, but maybe there's a reason for not compiling the content altogether? For the record, this is my simplified view code: <div ng-if="flag">
<div oc-lazy-load="'asyncModule'">
<ng-include src="'templateSrc'"></ng-include>
</div>
</div> Using angular 1.4.6. For some other reason that I didn't want to investigate it works fine without the ng-if. |
This directive proves to be harder to support all the cases than expected :) |
Alright, I went back to #168, to find the source for this. Run some quick tests - true that angular doesn't like So the trick is not to store the HTML string as the original content, but the contents element itself. I've created a PR with this. #240 |
I found some issues using the directive and having ngAnimate turned on in an Angular 1.2.13 app. I believe this is related to the issue above. |
I've updated from 1.0.0-beta-2 to 1.0.0, the following declaration has stopped working for me:
I can see that
/vendors/file1.js
&/vendors/file2.js
were loaded, butmy-directive
never got compiled. fyimy-directive
is not inside those files, it was loaded before.In the docs you mention different syntax, but it produces an error:
The text was updated successfully, but these errors were encountered: