Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.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 如果我用angular js在控制台中获取数据,如何在Ui中显示数据_Javascript_Html_Angularjs - Fatal编程技术网

Javascript 如果我用angular js在控制台中获取数据,如何在Ui中显示数据

Javascript 如果我用angular js在控制台中获取数据,如何在Ui中显示数据,javascript,html,angularjs,Javascript,Html,Angularjs,我已经为这个页面编写了一个html文件和相应的控制器逻辑,我正在控制台中获取数据,但这些数据并没有显示在我的UI中 <div id="panelDemo14" class="panel panel-default" ng-controller="NoticeController"> <div class="panel-heading">Enter Notice here</div> <div class="panel-body"&

我已经为这个页面编写了一个html文件和相应的控制器逻辑,我正在控制台中获取数据,但这些数据并没有显示在我的UI中

<div id="panelDemo14" class="panel panel-default" ng-controller="NoticeController">


     <div class="panel-heading">Enter Notice here</div>
     <div class="panel-body">
        <tabset>

            <!-- SECOND TAB -->
            <tab heading="Notice List">

                      <div class="panel panel-default" ng-controller="NoticeController "  >
     <div class="panel-body">

将数据定义为,
$scope.mydata=data
,然后在ng重复使用中,
g in mydata
将AJAX响应设置为控制器模型,如下所示:


$scope.$data=data

我们应该如何解决这个问题?仅仅知道你的评论,我们需要知道写的是什么代码。你能提供你的代码吗?无法回答您的问题“它就是不起作用”。)我还添加了我的代码,你可以查看我的代码。。。。。。
        <div class="row">
           <div class="col-md-12">
               <div class="box-placeholder">


                      <!-- START DATATABLE 1 -->




                                <div class="panel panel-default  {{ dataLoad }}">
                                                                        <div class="panel-heading">

                                                                             <a ng-mousedown="csv.generate()" ng-href="{{ csv.link() }}" download="test.csv" class="pull-right btn btn-sm btn-info">Export to CSV</a>
                                                                             <div ng-if="gradeFilter" class="panel-title">Classes</div>
                                                                        </div>
                                                                        <div class="table-responsive ">

                                                                           <table ng-table="table.tableParams" export-csv="csv" show-filter="true" class="table table-bordered table-striped">




                                                                               <tr ng-repeat="g in $data ">
                                                                                     <td data-title ="'Topic'" align="center" >{{g.noticeId}}</td>

                                                                                    <td data-title ="'Message'" align="center" >{{g.message}}</td>
                                                                                    <td data-title ="'Sender'" align="center" >{{ g.senderName    }} </td>
                                                                                    <td data-title ="'Date'" align="center" >{{ g.date | cmdate:'dd-MMM-yyyy' }}</td>
                                                                                    <td align="center"><a ui-sref="admin.viewEditnotice({nid : g.noticeId})">View </a></td>
                                                                                 </tr>

                                                                           </table>
                                                                        </div>
                              </div>


               </div>
           </div>



        </div>
     </div>
  </div>
enter code here/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
console.log('Notice loaded');

App.controller('NoticeController', ["$scope","$http","$stateParams","Notice","toaster","APISource",function($scope,$http,$stateParams,Notice,toaster,APISource) {
  'use strict';





 $http.get(APISource.currentApiPoint+"/app/notice")
        .success(function(data){

  console.log(JSON.stringify(data))

        })
        .error(function(data)
        {

        });