我更喜欢在全局范围内引入“ _”并且可以注入以进行测试。
var myapp = angular.module('myApp', []) // allow DI for use in controllers, unit tests .constant('_', window._) // use in views, ng-repeat="x in _.range(3)" .run(function ($rootScope) { $rootScope._ = window._; });


