0
angular.module('lawgauge')
.directive('mainheader', function() {
return {
restrict: 'A',
templateUrl:'/angular/templates/header',
};
});
該指令加載頁眉模板,但會渲染兩次。 我這樣稱呼它:AngularJS指令將模板渲染兩次
<header class="nclear" mainheader ></header>
這是問題的截圖:https://yadi.sk/i/0HEjsf1uhHYom 我能做些什麼這個問題呢?
笏不模板文件是什麼樣子? – thomaux
是否有機會在另一個位置定義了兩次指令? – im1dermike
它只是一個html,不管什麼文件包含 - 無論如何渲染兩次。 –