2016-06-02 6 views
0

Hallo ich bin neu AngularJS, habe ich ein Problem habe, während AngularJS Datentabellen von http://l-lin.github.io/angular-datatables/#/zeroConfig heruntergeladen haben, Fehler immer wie Typeerror: this.renderDataTableAndEmitEvent ist keine Funktion Ich habe die Skripte in der richtigen Reihenfolge angeordnet, bekomme aber das gleiche Problem auch danach.AngularJS Datentabellen Typeerror: this.renderDataTableAndEmitEvent ist keine Funktion

mein AngularJS Code ist

var myApp = angular.module('myApp', ['datatables']); 
myApp.controller('AppCtrl', ['$scope', '$http', function($scope, $http) { 
    $http.get('/contactlist').success(function(response){ 
     console.log(response); 
     $scope.contactlist = response; 
    }); 
}]); 

folgende ist mein HTML-Code

<html xmlns="http://www.w3.org/1999/xhtml" ng-app="myApp"> 
<script src="datatable/jquery.min.js"></script> 
<script src="datatable/jquery.dataTables.min.js"></script> 
<script src="datatable/angular.min.js"></script> 
<script src="datatable/angular-datatables.min.js"></script> 
<link rel="stylesheet" href="datatable/datatables.min.css"> 
<script src="controllers/contactlistcontroller.js"></script> 
<div class="container" ng-controller="AppCtrl"> 
<h1>Contact List App</h1> 

<table width="100%" border="1" cellspacing="1" cellpadding="2" class="table" datatable=""> 
<thead> 
    <tr> 
    <td>Name</td> 
    <td>Email</td> 
    <td>Number</td> 
    <td>Action</td> 
    <td>&nbsp;</td> 
    </tr> 
    </thead> 
    <tbody> 
    <tr ng-repeat="contact in contactlist"> 
    <td>{{ contact.name}}</td> 
    <td>{{ contact.email}}</td> 
    <td>{{ contact.number}}</td> 
    <td><button ng-click="remove(contact._id)" class="btn-danger">Remove</button></td> 
    <td><button ng-click="edit(contact._id)" class="btn-warning">Edit</button></td> 
    </tr> 
    </tbody> 
</table> 
</div> 
</html> 

Iam der Lage, meine Daten in der Tabelle zu drucken, aber Datentabellen sind nicht Vielen Dank im Voraus Anwendung.

Antwort

0

Sie bekommen diesen Fehler wegen "angular-datatables.min.js", ersetzen Sie dies durch neue und Ihr Fehler wird gelöst.