【发布时间】:2016-12-07 09:56:29
【问题描述】:
好的,首先我从凉亭安装它:
bower install angular-underscore-module
然后在 modules/core/clients/app/config.js 的第 7 行添加了注入:
var applicationModuleVendorDependencies = ['ngResource', 'ngAnimate', 'ngMessages', 'ui.router', 'ui.bootstrap', 'ui.utils', 'angularFileUpload', 'underscore'];
要将其注入我的控制器,在 modules/articles/client/controllers/articles.client.controller.js 我是这样添加的:
angular.module('articles').controller('ArticlesController', ['$scope', '$stateParams', '$location', 'Authentication', 'Articles', '_',
function ($scope, $stateParams, $location, Authentication, Articles, _) {
然后,我得到了这个错误:
angular.js:13920 Error: [$injector:undef] Provider '_' must return a value from $get factory method.
那么在这篇文章中: Provider 'xx' must return a value from $get factory method in AngularJs
它说,我应该在 return 前面插入 { 而不是在下一行,但是,我找不到那个 return。我在这里做错了吗?请建议。谢谢。
【问题讨论】:
标签: javascript angularjs underscore.js meanjs