我正在使用一个指令在我的页面上注入一些特定的内容。我们有一个要求,当url属性指向html文件时,该文件的内容需要在我的页面上呈现。我如何才能做到这一点?
<section>
<block-with-html
url = "locatiion of html file">
</block-with-html>
</section>
angular
.module('app.blockWithHtml', [])
.directive('blockWithHtml', BlockWithHtmlDirective);
function BlockWithHtmlDirective(ConfigBlocksService) {
return {
restrict: 'E',
scope: {
url: '='
},
template: `
<section >
<h4>block with html</h4>
<div>content form the html file goes here</div>
</section>
`,
}
}发布于 2018-08-04 16:57:08
https://stackoverflow.com/questions/51683948
复制相似问题