[$ Injector:modulerr]无法实例化模块myapp到期 [英] [$Injector:modulerr] failed to instantiate module myapp due

查看:88
本文介绍了[$ Injector:modulerr]无法实例化模块myapp到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML:



HTML:

<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>





Javascript:





Javascript:

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');
}
}
]);
}]);





我尝试过:



嗨伙计们我使用了角度数据表,我完成了所有的事情,但我得到了一些错误,由下面的图像显示。如何纠正这个错误:





What I have tried:

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:

推荐答案

scope','
scope', '


http',' DTOptionsBuilder DTColumnBuilder'
function
http', 'DTOptionsBuilder', 'DTColumnBuilder', function (


scope,


这篇关于[$ Injector:modulerr]无法实例化模块myapp到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆