Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en" ng-app="domaci8">
- <head>
- <style>
- table {
- font-family: arial, sans-serif;
- border-collapse: collapse;
- width: 100%;
- }
- td, th {
- border: 1px solid #dddddd;
- text-align: left;
- padding: 8px;
- }
- tr:nth-child(even) {
- background-color: #dddddd;
- }
- </style>
- <meta charset="UTF-8">
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-route.js"></script>
- <script type="text/javascript" src="main.js"></script>
- <title>Domaci 8</title>
- </head>
- <body>
- <div ng-controller="CtItem">
- <table>
- <tr>
- <th>Id</th>
- <th>Name</th>
- <th>Price</th>
- <th>Quantity</th>
- </tr>
- <tr ng-repeat="item in items">
- <td>{{item.id}}</td>
- <td>{{item.name}}</td>
- <td>{{item.price}}</td>
- <td>{{item.quantity}}</td>
- </tr>
- </table>
- <br>
- <form novalidate>
- <input type="number" ng-model="count">
- <br>
- <br>
- <button ng-click="nextTen()">Load</button>
- </form>
- <br>
- <form novalidate>
- <button ng-click="getItems()">Load all items</button>
- </form>
- <br>
- <form novalidate>
- Name: <br> <input type="text" ng-model="item.name"> <br>
- Price: <br> <input type="number" ng-model="item.price"> <br>
- Quantity: <br> <input type="number" ng-model="item.quantity"> <br>
- <br>
- <button ng-click="addItem()">Add item</button>
- </form>
- <br>
- <form novalidate>
- <select ng-model="searchKey">
- <option value="name" selected="selected">Item name</option>
- <option value="price">Item price</option>
- </select>
- <br>
- <br>
- <input type="text" ng-model="searchParam">
- <br>
- <br>
- <button ng-click="searchItem()">Search item</button>
- </form>
- </div>
- <br>
- <div ng-controller="CtUser">
- <form novalidate>
- Username: <br> <input type="text" ng-model="userReg.username"> <br>
- Password: <br> <input type="password" ng-model="userReg.password"> <br>
- <br>
- <button ng-click="register()">Register</button>
- </form>
- <p>{{msgReg}}</p>
- <form novalidate>
- Username: <br> <input type="text" ng-model="userLog.username"> <br>
- Password: <br> <input type="password" ng-model="userLog.password"> <br>
- <br>
- <button ng-click="login()">Log In</button>
- </form>
- <p>{{msgLog}}</p>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement