My current code is causing a discrepancy in the output between ng-bind
and {{}}
, and I need help understanding why.
angular.module('Test', []);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="Test">
<input type="text" ng-model="foo.bar" />
<input type="text" ng-model="foo.baz" />
<p ng-bind="foo"></p>
<p>{{ foo }}</p>
</div>
The current output I am seeing
//for ng-bind
[object Object]
//for {{}}
{"foo":"ankur","bar":"23"}