3
我試圖使用模態編輯窗體,模態是在ng模板腳本中,但單擊編輯按鈕時不顯示窗體數據。
$範圍對模板腳本不可用。
我創建了一個Plunker here
$scope.setCurrentItem = function (item) {
$scope.currentItem = item;
};
$scope.edit = function (item) { //editing item
$scope.setCurrentItem(angular.copy(item));
//$scope.editItem = item;
openEditModal();
};
<!--html-->
<script type="text/ng-template" id="myModalContent.html">
<label for="name">Role: </label>
<input type="text" ng-model="currentItem.roleName" required />
</script>
我該如何解決呢?
謝謝! PSL;我看到了什麼問題。 – Red 2014-10-29 05:06:37