<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="angular-1.3.0.js"></script> <script type="text/javascript" src="jquery-1.11.0.js"></script> <script type="text/javascript"> var app = angular.module("myapp",[]); app.controller("bookcril", function($scope,$http){ $http({ method:"GET", url:"book.json" }).success(function(data,status,headers,config){ $scope.s=data; }).error(function(data,status,headers,config){ alert("错误!"); }); }); </script> </head> <body ng-app="myapp"> <div ng-controller="bookcril"> <ul> <li>ID:{{ s.id }}</li> <li>标题: {{ s.title }}</li> <li>类型: {{ s.type }}</li> <li>描述:{{ s.description }}</li> <li>图片:<img src="{{s.picture}}"></li> <li>是否推荐:{{ s.isRecommend }}</li> <li>上架时间:{{ s.dtCreated }}</li> </ul> </div> </body> </html>
angular
最新推荐文章于 2018-04-21 16:24:29 发布