【发布时间】:2016-04-18 10:31:43
【问题描述】:
我在 angular-meteor.com 上做教程。角力矩效果很好。然后我将一些 Ionic 元素添加到 html 页面并将空存根方法添加到控制器。并得到消息:
13:07:29.038 错误:[$injector:modulerr] 无法实例化模块 Whatsapp 由于:[$injector:modulerr] 无法实例化模块 角矩由于:[$injector:nomod] 模块“角矩”是 无法使用!您拼错了模块名称或忘记加载 它。如果注册一个模块,请确保您指定依赖项 作为第二个论点。 http://errors.angularjs.org/1.5.3/$injector/nomod?p0=角矩 minErr/http://localhost:3000/packages/modules.js?hash=a65f000925e20c56ee4ab84205897b99db3e2c9f:232:12 模块/http://localhost:3000/packages/modules.js?hash=a65f000925e20c56ee4ab84205897b99db3e2c9f:2198:1 确保@http://localhost:3000/packages/modules.js?hash=a65f000925e20c56ee4ab84205897b99db3e2c9f:2122:38 模块@http://localhost:3000/packages/modules.js?hash=a65f000925e20c56ee4ab84205897b99db3e2c9f:2196:1 加载模块/http://localhost:3000/packages/modules.js?hash=a65f000925e20c56ee4ab84205897b99db3e2c9f:4688:22 forEach@http://localhost:3000/packages/modules.js?hasminErr/
我通过将更改注释掉来回滚更改,但仍然出现此错误。
更新 以下代码导致错误:
import angular from 'angular';
import 'angular-animate';
import 'angular-meteor';
import 'angular-moment';
import 'angular-sanitize';
import 'angular-ui-router';
import 'ionic-scripts';
// Modules
import Definer from '../definer';
import ChatsCtrl from '../controllers/chats.controller';
import ChatCtrl from '../controllers/chat.controller';
import CalendarFilter from '../filters/calendar.filter';
import RoutesConfig from '../routes';
// App
const App = angular.module('Whatsapp', [
'angular-meteor',
'angular-moment',
'ionic'
]);
Module angular-moment 安装如下:
>meteor npm install --save angular-moment
angular-moment@1.0.0-beta.5 node_modules/angular-moment
└── moment@2.12.0
【问题讨论】:
标签: angularjs ionic-framework angular-meteor angular-moment