未捕获的错误:[$injector:nomod] 和未捕获的错误:[$injector:模块rr]
Uncaught Error: [$injector:nomod] and Uncaught Error: [$injector:modulerr]
我正在尝试使用angularjs,bootstrand和ui引导程序设置一个简单的SP应用程序,代码是从UI引导程序上的警报指令示例中复制粘贴的(目的是测试是否至少一个简单的事情有效),但事实并非如此。
我的 SP 页代码:
<%-- The following 4 lines are ASP.NET directives needed when using SharePoint components --%>
<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%-- The markup and script in the following Content element will be placed in the <head> of the page --%>
<asp:Content ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<script type="text/javascript" src="../Scripts/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.js"></script>
<meta name="WebPartPageExpansion" content="full" />
<!-- Add your CSS styles to the following file -->
<link rel="Stylesheet" type="text/css" href="../Content/App.css" />
<!-- Add your JavaScript to the following file -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="../Scripts/bootstrap.js"></script>
<script src="../Scripts/angular-ui/ui-bootstrap-tpls.js"></script>
<script type="text/javascript" src="../Scripts/App.js"></script>
</asp:Content>
<%-- The markup in the following Content element will be placed in the TitleArea of the page --%>
<asp:Content ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
AngularJS - Sharepoint List CRUD Sample
</asp:Content>
<%-- The markup and script in the following Content element will be placed in the <body> of the page --%>
<asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server">
<div class="container" ng-app="ui.bootstrap.demo">
<div ng-controller="AlertDemoCtrl">
<alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</alert>
<button class='btn btn-default' ng-click="addAlert()">Add Alert</button>
</div>
</div>
</asp:Content>
我的应用.js
'use strict';
angular.module('ui.bootstrap.demo').controller('AlertDemoCtrl', function ($scope) {
$scope.alerts = [
{ type: 'danger', msg: 'Oh snap! Change a few things up and try submitting again.' },
{ type: 'success', msg: 'Well done! You successfully read this important alert message.' }
];
$scope.addAlert = function () {
$scope.alerts.push({ msg: 'Another alert!' });
};
$scope.closeAlert = function (index) {
$scope.alerts.splice(index, 1);
};
});
我在标题中收到 2 个错误
我想js文件的顺序搞砸了?
将
模块定义更改为
angular.module('ui.bootstrap.demo', [ui.bootstrap]).....
您需要添加 UI.bootstrap 作为依赖项
相关文章:
- 错误:$injector:modulerr模块错误(我的第一个SPA应用程序)
- 错误:$injector:modulerr加载图像时模块处于角度
- Karma Jasmine角度错误:[$injector:nomod]
- 为什么我得到错误:$injector:unp未知提供程序
- 未捕获错误:由于,[$injector:moduler]未能实例化模块polmgr
- 未捕获的错误: [$injector:modulerr] http ..(使用纯 HTML)
- 角度.js:38未捕获错误:[$injector:模块rr]
- 在出厂时注入服务错误: [$injector:unpr] 未知提供程序: $scopeProvider <- $scop
- 未捕获的错误:使用 ng-repeat 时出现 [$injector:modulerr]
- 未捕获的错误: [$injector:modulerr] - 角度 ng-include
- AngularJS错误:$injector:unp未知提供程序-$modalInstanceProvider
- AngularJS中的$injector.unpr错误
- Angularjs未捕获错误:迁移到V1.3时出现[$injector:modulerr]
- Angular小部件中的Angular Grid返回错误:[$injector:unp]未知提供程序:
- 未捕获错误:[$injector:modulerr](新手)
- 错误:$injector:unp未知提供者:未知提供者:bProvider<-b
- AngularJS错误:$injector:modulerr我的浏览器窗口中出现模块错误
- 当脚本是“有角度的$injector错误”时;动态地“;加载
- 使用角度引导时出现$injector错误($modalInstanceProvider<-$modalInstan
- Angular控制器抛出$injector错误