I recently started delving into Angular JS and have been following tutorials to learn it.
One issue I'm facing is that my model doesn't seem to update the view. Can anyone help me figure out why this is happening?
Here is the code snippet:
<!DOCTYPE html>
<div ng-controller="MyContr">
{{xxx}}
</div>
<input type="text" ng-model="xxx" ng-controller="MyContr" />
<script>
var app = angular
.module("MyApp", [])
.controller("MyContr", function ($scope) {
var xxx="Alexander"
$scope.xxx = xxx;
});
</script>