I am trying to store the input values in JSON object and binding the JSON object to Span. its not working. Direct ng-repeat is working, but if i bind it from JSON objeci its not working.
My code:
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"> </script>
<script type="text/javascript">
var JSONObject = {"name":"{{yourName}}"
};
document.getElementById("jname").innerHTML=JSONObject.name;
</script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
<p>
Name: <span id="jname"></span>
</p>
</div>
</body>
</html>
In header its working, in span i am binding from JSON its not working. I tried in jsbin the same code its working.but if i create my own html its not working.
Help me.
Thanks in Advance, Stephen.L