TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
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');
}
}
]);
}]);
Reply
Answers (
3
)
How To add append Div to textbox using angularjs
Add row with new button