好的,第一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