179
rated 0 times
[
184]
[
5]
/ answers: 1 / hits: 16168
/ 11 Years ago, wed, december 4, 2013, 12:00:00
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.
More From » angularjs