יום ראשון, 9 ביוני 2013

simple angular js

Very simple angular page
The HTML view

  1: <!doctype html>
  2: <html ng-app>
  3:   <head>
  4:     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
  5:     <script src="operators.js"></script>
  6:     <link rel="stylesheet" href="operators.css">
  7:   </head>
  8:   <body>
  9:     <h2>Operators</h2>     
 10:     <div ng-controller="OperatorsContoller">     
 11:       <ul >
 12:         <li ng-repeat="operator in operators">         
 13:           <span>{{operator.name}}</span>           
 14:         </li>
 15:       </ul>
 16:     </div>
 17:   </body>
 18: </html>

The  controller


  1: function OperatorsContoller($scope) {
  2:     $scope.operators = [
  3:       { "name": "Zvika" },
  4:       { "name": "Gal" }];
  5: }
The Result
Capture23

אין תגובות:

הוסף רשומת תגובה