-
-
Save IgorMinar/1293065 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://code.angularjs.org/angular-0.10.3.js" ng:autobind></script> | |
<script> | |
function MyCntrl() { | |
this.list_of_items = ['this', 'that', 'the other']; | |
this.foo = {choice:'that'}; | |
} | |
MyCntrl.prototype = { | |
loadData: function(){ | |
this.foo = {choice:'that'}; | |
} | |
} | |
</script> | |
</head> | |
<body ng:controller="MyCntrl"> | |
<ul> | |
<li ng:repeat="item in list_of_items"> | |
<input type="radio" ng:model="foo.choice" value="{{item}}" name="choice" | |
id="item_{{$index}}"> | |
<label for="item_{{$index}}"> | |
<code>{{item}}</code> | |
</label> | |
</li> | |
<a class="action" href="" ng:click="loadData()">Load</a> | |
</ul> | |
choice: {{foo}} | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment