0
CONTENTEDITABLE格值我有一個CONTENTEDITABLE DIV這樣的:獲取角
<div contenteditable="true" ng-model="name">{{ name }}</div>
<input type="button" ng-click="checkScope()" value="Click me">
在我的控制器:
var app = angular.module('sbAdminApp', []);
app.controller('MyCtrl', function($scope) {
$scope.name = 'Adrian';
$scope.checkScope = function(){
console.log($scope.name);
}
});
我如何使用範圍,當我點擊獲得CONTENTEDITABLE div的最新值按鈕?
我想更新的範圍值,所以怎麼能我在element.bind函數中獲得當前可編輯的div範圍(如當前情況下的「名稱」)。 – Rahul
指令正在更新'$ scope.name'屬性 –
好極了,我會錯誤的方向..感謝您的最後評論。 +1 – Rahul