Skip to content

Instantly share code, notes, and snippets.

@IgorMinar
Forked from mhevery/gist:891437
Created October 17, 2011 16:55
Show Gist options
  • Select an option

  • Save IgorMinar/1293065 to your computer and use it in GitHub Desktop.

Select an option

Save IgorMinar/1293065 to your computer and use it in GitHub Desktop.

Revisions

  1. IgorMinar revised this gist Oct 17, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    <html>
    <head>
    <script src="http://code.angularjs.org/angular-0.9.13.js" ng:autobind></script>
    <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'];
    @@ -16,7 +16,7 @@
    <body ng:controller="MyCntrl">
    <ul>
    <li ng:repeat="item in list_of_items">
    <input type="radio" name="foo.choice" value="{{item}}"
    <input type="radio" ng:model="foo.choice" value="{{item}}" name="choice"
    id="item_{{$index}}">
    <label for="item_{{$index}}">
    <code>{{item}}</code>
  2. @mhevery mhevery created this gist Mar 28, 2011.
    29 changes: 29 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <html>
    <head>
    <script src="http://code.angularjs.org/angular-0.9.13.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" name="foo.choice" value="{{item}}"
    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>