mapApp.controller("myController", function ($scope,$http) {
$scope.namePlaceHolder= "Name";
$scope.name = "";
};
I bound a scope variable to an html input as follows.
<input id="foo" type="text" placeholder="{{namePlaceHolder}}" ng-model="name" value="{{name}}"/>
If a user types something in text box the $scope.name property changes. But when I change it using javascript the $scope.name data doesn't change.
on(document.getElementById("button"), "click", function (e) {
document.getElementById("foo").value = "ascd...";
})
This code does not populate $scope.name data.