gpt4 book ai didi

angularjs - 未知提供商 : uiCropperProvider <- uiCropper

转载 作者:太空宇宙 更新时间:2023-11-04 00:09:44 26 4
gpt4 key购买 nike

我正在尝试研究图像裁剪功能并使用“https://www.npmjs.com/package/ui-cropper ”库。

但是当我集成到我的代码中时,它不断抛出错误未知提供程序:uiCropperProvider <- uiCropper

这是我的 Controller

 (function () {
'use strict';

// Widgets controller
angular
.module('widgets')
.controller('EditWidgetController', EditWidgetController);

EditWidgetController.$inject = ['$scope', '$rootScope', '$state', '$window', 'Authentication', 'WidgetsService', '$firebaseStorage', '$firebaseAuth', 'UsersService', 'Upload', 'FirebaseService', 'Notification', '$base64', 'widgetResolve', '$stateParams', '$firebaseArray', '$interval', 'uiCropper'];

function EditWidgetController($scope, $rootScope, $state, $window, Authentication, WidgetsService, $firebaseStorage, $firebaseAuth, UsersService, Upload, FirebaseService, Notification, $base64, widget, $stateParams, $firebaseArray, $interval, uiCropper) {

这里我定义了库路径

enter image description here

我收到错误:

enter image description here

请建议我如何克服这个错误。它正在吃我的头:(

提前非常感谢

最佳答案

从上面的对话中,我可以建议您使用 angular.module('widgets', []) 检查文件,并将 uiCropper 作为 DI 注入(inject)其中。

angular.module('widgets', ['uiCropper' , 'Some_other_modules']) // <-- Try this injection of `uiCropper`

注意:

angular.module('widgets', []).controller()angular.module('widgets').controller() 不同。不同之处在于,使用 [ ] ,您基本上是在声明 Angular 模块

Play around in this plunkr to get the idea. app.js 没有 angular.module('plunker', []) 其中 other.js 具有 angular.module('plunker')。另外,检查 index.html 中包含的文件顺序。声明文件位于其他文件之前

关于angularjs - 未知提供商 : uiCropperProvider <- uiCropper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50446337/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com