AngularJS 制作 F1 车手积分 App Posted on 2014-08-22 | In Front-End | AngularJS 制作 F1 车手积分 App12345678910111213141516171819202122232425262728293031323334353637383940414243<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <title>F1 Feed App</title> </head> <body ng-app="F1FeedApp" ng-controller="driverController"> <table> <thead style="position: fixed; background-color: white"> <tr> <th colspan="4">Drivers Championship Standings</th> </tr> <tr> <th colspan="4">Search: <input type="text" ng-model="name"></th> </tr> </thead> <tbody> <tr><td colspan="4">&nbsp;</td></tr> <tr><td colspan="4">&nbsp;</td></tr> <tr ng-repeat="driver in driversList | filter:name"> <td>{ { $index + 1 }}</td> <td> { {driver.Driver.givenName + " " + driver.Driver.familyName}} </td> <td>{ {driver.Constructors[0].name}}</td> <td>{ {driver.points}}</td> </tr> </tbody> </table> </body> <script src="bower_components/jquery/dist/jquery.min.js"></script> <script src="bower_components/angular/angular.min.js"></script> <script> var app = angular.module("F1FeedApp", []); app.controller("driverController", function($scope, $http){ $http.get("http://ergast.com/api/f1/2013/driverStandings.json") .success(function(response) { $scope.driversList = response.MRData.StandingsTable.StandingsLists[0].DriverStandings; }); }); </script></body></html>