I have a contenteditable div like this:
<div contenteditable="true" ng-model="name">{{ name }}</div>
<input type="button" ng-click="checkScope()" value="Click me">
In my controller:
var app = angular.module('sbAdminApp', []);
app.controller('MyCtrl', function($scope) {
$scope.name = 'Adrian';
$scope.checkScope = function(){
console.log($scope.name);
}
});
How can I get the latest value of contenteditable div using scope when I click the button?