HTML:
<section>
<!-- <div ng-controller="Ctrl"> -->
<div nt-attr-dir></div>
</section>
script.js
angular.module('docsSimpleDirective', [])
.directive('ntAttrDir', function factory() {
var directiveDefinitionObject = {
template: "<div> Test </div>",
replace:false,
restrict:"A"
};
return directiveDefinitionObject;
});
So expected result is the html-code should look like
<section>
<!-- <div ng-controller="Ctrl"> -->
<div nt-attr-dir><div> Test </div></div>
</section>
But it looks always as below
<section>
<!-- <div ng-controller="Ctrl"> -->
<div nt-attr-dir></div>
</section>
What am I missing so that Test is not being displayed.
ng-app
directive missing: <html ng-app="docsSimpleDirective">
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.