【问题标题】:ng-transclude error when using md-button使用 md 按钮时出现 ng-transclude 错误
【发布时间】: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


【解决方案1】:

我遇到了同样的问题。我可以通过从我的索引屏幕中删除 ng-app 来修复它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-20
    • 2021-09-14
    • 2013-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-17
    相关资源
    最近更新 更多