發現這個可選參數就是閑的蛋疼!!! 不多說,看代碼 可選參數:replace 預設為false,可以設定為true 若設定為true,dom中顯示為: AngularJS自定義指令之可選參數replace 若設定為false AngularJS自定義指令之可選參數replace