在 IE7 和 IE8 中动态编译 angular 指令的问题

Issue with dynamic compiling of angular directive in IE7 and IE8

我正在尝试在我的应用程序中动态编译一个指令。我试过的是这样的;

    $scope.newPaneString = '<vmf-split-container>' +
        '<vmf-split-pane-component paneheight="30%" minwidth="30%" maxwidth="70%">' +
            <!--Some content comes in here-->
        '</vmf-split-pane-component>' +
        '<vmf-split-pane-divider paneheight="10px" clicks="0" close="bottom"></vmf-split-pane-divider>' +
        '<vmf-split-pane-component>' +
            <!--Some content comes in here-->
        '</vmf-split-pane-component>' +
        '</vmf-split-container>';
         $compile($scope.newPaneString)($scope)

这里 <vmf-split-container> 是父指令,<vmf-split-pane-component>, <vmf-split-pane-divider> 是子指令,它依赖于使用指令的 require 选项的父指令,例如;

require: '^vmfSplitContainer',

问题来了。当我尝试使用 $compile 动态编译此指令时,出现以下错误;

 http://errors.angularjs.org/1.2.27/$compile/ctreq?0=vmfSplitContainer&p1=vmfSplitPaneComponent

它只发生在 IE7 和 IE8 上。请帮我解决这个问题。

尝试使用属性表示法代替元素表示法以使 IE 正常工作。