<!doctype html>
<html ng-app="zns_weibo">
<head>
<meta charset="utf-8">
<title>微博评论</title>
<link href="style/weibo.css" rel="stylesheet" type="text/css" />
<script src="angular-1.6.8.js"></script>
<script>
var app=angular.module('zns_weibo', []);
app.controller('weibo', function ($scope, $http){
$scope.replies=[];
$scope.pages=[];
$scope.curPage=1;
//获取当前页留言并显示
$scope.getPage=function(p) {
$scope.curPage=p;
setCur($scope.pages.length);
$http.get('weibo.php', {
params: {act: 'get', page: p}
}).success(function (arr){
$scope.replies=arr;
}).error(function (){
alert('读取失败,请稍后重试');
});
}
getPage(1);
//提交留言
$scope.submitMsg=function (){
$http.get('weibo.php', {
params: {act: 'add', content: $sc
angular 实践小项目(仿微博评论)学习总结
最新推荐文章于 2020-01-18 22:19:55 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)