好的,第一I从亭子安装这样的:在模块如何将下划线模块添加到MeanJS?
bower install angular-underscore-module
接着/核心/客户端/应用程序/ config.js中,管线7 I加入注射:
var applicationModuleVendorDependencies = ['ngResource', 'ngAnimate', 'ngMessages', 'ui.router', 'ui.bootstrap', 'ui.utils', 'angularFileUpload', 'underscore'];
为了注射它在我的控制器,模块/条/客户/控制器/ 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
它说,我应该插入{回报的前面,而不是在下一行,但是,我无法找到的回报。我在这里做错了什么?请建议。谢谢。
谢谢你,但问题是关于meanjs,而不是角度服务。 – Vicheanak