mari muthu

mari muthu

  • NA
  • 198
  • 107.6k

[$injector:modulerr] Failed to instantiate module MyApp due

Oct 17 2016 11:53 AM
hi guys i used angular datatable i completed every thing but am getting some Error which showned by image below .how to rectify this Error 
 
Error:
 
[$injector:modulerr] Failed to instantiate module MyApp due to:
Error: [$injector:modulerr] Failed to instantiate module datatables due to:
 
<html>
<head>
@* CSS *@
<styles>
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<link href="~/Content/DataTables-1.10.12/media/css/jquery.dataTables.css" rel="stylesheet" />
<link href="~/Content/DataTables-1.10.12/media/css/jquery.dataTables.min.css" rel="stylesheet" />
</styles>
<scripts>
<scripts src="~/scripts/jquery-1.9.1.js"></scripts>
<script src="~/scripts/DataTables-1.10.12/media/js/jquery.dataTables.js"></script>
<script src="~/scripts/angular.js"></script>
<script src="~/scripts/src/angular-datatables.js"></script>
<script src="~/scripts/myApp.js"></script>
</scripts>
@* JS for angularJS and Datatable *@
</head>
<body>
<div ng-app="MyApp" class="container">
<div ng-controller="homeCtrl">
<table id="entry-grid" datatable="" dt-options="dtOptions" dt-columns="dtColumns" class="table table-hover"></table>
</div>
</div>
</body>
</html>
 
 
 
 
 
 
 
var app = angular.module('MyApp', ['datatables']);
app.controller('homeCtrl', ['$scope', '$http', 'DTOptionsBuilder', 'DTColumnBuilder',
function ($scope, $http, DTOptionsBuilder, DTColumnBuilder) {
$scope.dtColumns = [
DTColumnBuilder.newColumn("EmployeeName", "EmployeeName"),
DTColumnBuilder.newColumn("Department", "Department"),
DTColumnBuilder.newColumn("DateofBirth", "DateofBirth"),
DTColumnBuilder.newColumn("Designation", "Designation"),
DTColumnBuilder.newColumn("ReportingManager", "Reporting Manager")
]
$scope.dtOptions = DTOptionsBuilder.newOptions().withOption('ajax', {
url: "/Datatable/GetAlldata",
type: "GET"
})
.withPaginationType('full_numbers')
.withDisplayLength(10).withButtons([
'columnsToggle',
'colvis',
'copy',
'print',
'excel',
{
text: 'Some button',
key: '1',
action: function (e, dt, node, config) {
alert('Button activated');
}
}
]);
}]);
 
 

Answers (3)