我正在開發一個SPA與Angular,該應用程序需要IE8 +支持。我最近把一個搜索功能列入了一個指令。 git提交之前,我添加指令工作正常,所以我敢肯定,錯誤是由該指令造成的。這裏的指令代碼:在IE8中的AngularJS - 錯誤:不支持此命令
myApp.directive('genericSearch', function() {
return {
restrict : 'A',
replace: true,
scope : {
interface: '=genericSearch'
},
controller: 'genericSearchController',
template : '<input class="generic-search" placeholder="Search" data-ng-model="model.searchText" data-ng-change="beginSearch()" />',
link : function(scope, element, attrs) {
scope.model = scope.interface.model || function() { };
scope.finished = scope.interface.finished || function() { };
scope.endpoint = scope.interface.endpoint || 'searchDirectory';
}
};
});
在我的視圖模板,該指令是這樣開始:
<input data-generic-search="searchInterface" />
現在,當我瀏覽到一個頁面,這個指令,我得到一個錯誤引用了NG-視圖元素: Error: This command is not supported.<:section class="is-scrollable ng-scope" data-ng-view="" ng-1400945355054="29">
任何想法這個錯誤來自哪裏?我已經嘗試過HTML5樣板,添加了不受支持的元素,例如section
,但在添加指令之前它正在工作,所以我不認爲這是問題所在。
編輯
的指令在IE9 +和Chrome證實工作的。 我猜它與輸入元素有關。我嘗試將原始元素更改爲div
,該元素被指令模板中的input
元素替換。沒有骰子。