我正在一个项目中,我需要使用electroJS平台在angular-filemanager上集成一个名为“ videogular”的视频插件。
的链接这是我的项目Dependency Injection:
(function (angular) {
'use strict';
var FileManagerApp = angular.module('FileManagerApp');
FileManagerApp.controller('FileManagerCtrl',
['$scope',
'$rootScope',
'$window',
'$translate',
'fileManagerConfig',
'item', 'fileNavigator',
'apiMiddleware',
function ($scope,$rootScope, $window, $translate, fileManagerConfig, Item, FileNavigator, ApiMiddleware)
这是视频依赖注入:
angular.module('myApp',
[
"ngSanitize",
"com.2fdevs.videogular",
"com.2fdevs.videogular.plugins.controls",
"com.2fdevs.videogular.plugins.overlayplay",
"com.2fdevs.videogular.plugins.poster"])
.controller('HomeCtrl',
["$sce", function ($sce) {
}]
);
当我尝试以这种方式集成它时:
(function (angular) {
'use strict';
var FileManagerApp = angular.module('FileManagerApp',
[
"ngSanitize",
"com.2fdevs.videogular",
"com.2fdevs.videogular.plugins.controls",
"com.2fdevs.videogular.plugins.overlayplay",
"com.2fdevs.videogular.plugins.poster"]);
FileManagerApp.controller('FileManagerCtrl',
[
'$scope',
'$sce',
'$rootScope',
'$window',
'$translate',
'fileManagerConfig',
'item',
'fileNavigator',
'apiMiddleware',
function (
$scope ,
$sce,
$rootScope,
$window,
$translate,
fileManagerConfig,
Item,
FileNavigator,
ApiMiddleware) {
请帮助我解决这个问题。
答案 0 :(得分:1)
您需要在FileManagerApp
模块中注入myApp
才能使用它。
angular.module('myApp',
[
"ngSanitize",
'FileManagerApp', // <--- here
"com.2fdevs.videogular",
"com.2fdevs.videogular.plugins.controls",
"com.2fdevs.videogular.plugins.overlayplay",
"com.2fdevs.videogular.plugins.poster"])
,或者反之亦然:
var FileManagerApp = angular.module('FileManagerApp',
[
"ngSanitize",
"myApp", // < -- here
"com.2fdevs.videogular",
"com.2fdevs.videogular.plugins.controls",
"com.2fdevs.videogular.plugins.overlayplay",
"com.2fdevs.videogular.plugins.poster"]);
注意
确保您没有注射
"com.2fdevs.videogular",
"com.2fdevs.videogular.plugins.controls",
"com.2fdevs.videogular.plugins.overlayplay",
"com.2fdevs.videogular.plugins.poster"
同时插入两个模块。