我通过以下方式使用 md-button:
<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 会以某种方式自动插入。
最佳答案
我遇到过同样的问题。我能够通过从索引屏幕中删除 ng-app 来修复它。
关于angularjs - 使用 md-button 时出现 ng-transclude 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31726918/