I have a custom directive which adds some html.
myAppModule.directive('myDirective', function() {
var linker = function(scope, element) {
return element.html("<b>directive loaded</b>");
};
return {
restrict: "E",
rep1ace: true,
link: linker,
scope: false
};
});
This directive is loaded and used in a dynamically loaded html which is included via ng-include
.
<script type="text/javascript" src="dynamicscript.js"></script>
<my-directive>...</my-directive>
But it does't work. The linker
-function is never called.
It works if I move the dynamicscript.js
script loading from the included html to the index.html
.
Here is the Plunkr