Skip to content

Instantly share code, notes, and snippets.

@mhevery
Created September 20, 2010 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhevery/587658 to your computer and use it in GitHub Desktop.
Save mhevery/587658 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript" src="http://angularjs.org/ng/js/
angular-debug.js" ng:autobind></script>
</script>
<script>
function Ctrl ()
{
this.master_1 =
{
val_a: "a",
val_b: "b",
selectedValue: "a"
}
this.master_2 =
{
selectedValue: "a"
}
this.form_1 = angular.copy( this.master_1 );
this.form_2 = angular.copy( this.master_2 );
}
</script>
</head>
<body xmlns:ng="http://angularjs.org" >
<div ng:controller="Ctrl">
<pre>form_1: {{form_1|json}}</pre>
<!-- does not work -->
<input type="radio" name="form_1.selectedValue" value="{{form_1.val_a}}" />{{form_1.val_a}}
<input type="radio" name="form_1.selectedValue" value="{{form_1.val_b}}" />{{form_1.val_b}}
<hr />
<pre>form_2: {{form_2|json}}</pre>
<!-- works -->
<input type="radio" name="form_2.selectedValue" value="a" />a
<input type="radio" name="form_2.selectedValue" value="b" />b
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment