【发布时间】:2015-07-30 14:43:23
【问题描述】:
我正在通过以下方式使用 md 按钮:
<md-button aria-label="edit" target-mode="edit" style="z-index: 9;right: 10px; top: 10px; position: absolute;"> <i class="fa fa-check"></i> </md-button>
并收到以下错误:
Error: [ngTransclude:orphan] Illegal use of ngTransclude directive in the template!
No parent directive that requires a transclusion found.
Element: <button class="md-button md-default-theme" ng-transclude="" aria-label="show" target-mode="show" style="z-index: 9;right: 10px; top: 10px; position: absolute;">
我一直试图弄清楚为什么会发生这种情况 - 也许有人以前有过这种情况?
顺便说一句 - 您在错误中看到的 ng-transclude 会以某种方式自动插入。
【问题讨论】:
-
你能添加一个 jsfiddle 或 plunkr 吗?
标签: angularjs angularjs-directive material-design angular-material