Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Html引导表未出现在屏幕上_Javascript_Html_Angularjs_Twitter Bootstrap_Bootstrap Table - Fatal编程技术网

Javascript Html引导表未出现在屏幕上

Javascript Html引导表未出现在屏幕上,javascript,html,angularjs,twitter-bootstrap,bootstrap-table,Javascript,Html,Angularjs,Twitter Bootstrap,Bootstrap Table,我在用html显示表格时遇到问题。当我在表中硬编码值时,它们会出现,但当使用angularjs时,它们不会出现。所以我认为这个问题与angualrjs的某些东西有关。以下是我试图显示的html代码: <div class="container"> <h2>Hover Rows</h2> <p>The .table-hover class enables a hover state on table rows:</p>

我在用html显示表格时遇到问题。当我在表中硬编码值时,它们会出现,但当使用angularjs时,它们不会出现。所以我认为这个问题与angualrjs的某些东西有关。以下是我试图显示的html代码:

 <div class="container">
 <h2>Hover Rows</h2>
 <p>The .table-hover class enables a hover state on table rows:</p>            
 <table class="table table-hover">
 <thead>
  <tr>
    <th>Friends</th>
  </tr>
 </thead>
 <tbody>
    <tr ng-repeat="Friends in AllUsersFriends">
        <td>{{Friends}}</td>
  </tr>
 </tbody>
 </table>
 </div>
我通过flask socketio接收一个数组,然后将该数组设置为我创建的$scope.AllUsersFriends数组。我在控制台中看到数据,但屏幕上没有显示行。如何使数据显示在屏幕上?谢谢。

请查看以下内容:

<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js"></script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">

 <table class="table table-hover">
    <tr><th>Friends</th></tr>
    <tr ng-repeat="x in friends"><td>{{x.name}}</td></tr>
 </table>

<script>
//App declaration
var app = angular.module('myApp',[]);
//Controller Declaration
app.controller('myCtrl',function($scope){
    $scope.friends = [{name: "Peter"},{name:"Laila"},{name:"Rosy"}];

});

</script>
</body> 
</html> 

朋友
{{x.name}
//应用程序声明
var-app=angular.module('myApp',[]);
//控制器声明
应用程序控制器('myCtrl',函数($scope){
$scope.friends=[{name:“Peter”},{name:“Laila”},{name:“Rosy”}];
});

希望,它解决了

因此,我修复了我的问题,问题是阵列中的数据实际上正在更新,但我的应用程序中有不同的页面,数据在我更改页面时就丢失了,然后我通过在服务中创建相同的阵列来解决问题,这样更改是全局的,并且数据不会从阵列中删除。所以表格总是显示出来,只是没有任何数据显示。
非常感谢您的console.log中的

您是否传递了任何HTML?可能是错误的标记导致行或过早结束,从而导致表不显示,或者可能是将表设置为显示的类:none。只是一个想法
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js"></script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">

 <table class="table table-hover">
    <tr><th>Friends</th></tr>
    <tr ng-repeat="x in friends"><td>{{x.name}}</td></tr>
 </table>

<script>
//App declaration
var app = angular.module('myApp',[]);
//Controller Declaration
app.controller('myCtrl',function($scope){
    $scope.friends = [{name: "Peter"},{name:"Laila"},{name:"Rosy"}];

});

</script>
</body> 
</html>