Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title></title>
- <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
- <script src="radioApp.js"></script>
- <script src="radioController.js"></script>
- </head>
- <body ng-app="radioApp">
- <div ng-controller="radioController">
- <table>
- <tr ng-repeat="x in model | orderBy: 'ID'">
- <th ng-click="toTop(model.indexOf(x))" ng-show="model.indexOf(x) > 0">↑</th>
- <th ng-show="model.indexOf(x) === 0"> </th>
- <th ng-click="toBottom(model.indexOf(x))" ng-show="model.indexOf(x) < model.length - 1">↓</th>
- <th ng-show="model.indexOf(x) === model.length - 1"> </th>
- <th><input type="radio" name="test" /></th>
- <th ng-show="!x.edit"><div ng-click="edit(model.indexOf(x))">{{ x.value }}</div></th>
- <th ng-show="x.edit">
- <input type="text" value="{{ x.value }}" ng-model="x.value"/>
- </th>
- <th ng-show="!x.edit">
- <button ng-click="edit(model.indexOf(x))">Edytuj</button>
- <button ng-click="delete(model.indexOf(x))">Usuń</button>
- </th>
- <th ng-show="x.edit">
- <button ng-click="cancel(model.indexOf(x))">Anuluj</button>
- <button ng-click="save(x)">Zapisz</button>
- </th>
- </tr>
- </table>
- <div>
- <input ng-model="newItem" type="text"/>
- <button ng-click="add()">Dodaj</button>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment