angularMultipleSelect指令导入错误

时间:2019-03-14 15:09:25

标签: javascript angularjs ecmascript-6 es6-modules

我将Angularjs 1.7.0与es6模块一起使用。我需要使用angularMultipleSelect指令让用户选择多个选项。我无法将模块导入我的角度模块。

我通常通过npm install安装依赖项,然后像这样导入它们:

import angular from 'angular';
import routing from '../../app.config';

import { HomePremium } from './home-premium.component';
import ngMaterial from 'angular-material'; 

此ngMaterial模块是一个外部模块的示例,该模块在导入时可以正常工作

import multipleSelect from 'angular-multiple-select/build/multiple-select'; 
export const HomeModule = angular
    .module('home-premium', [
        ngMaterial,
        multipleSelect 
    ])
    .service('utilsService', UtilsService)
    .component('homePremium', HomePremium)
    .config(routing);

但是,当我导入此模块时,模块中出现错误

Uncaught Error: [$injector:modulerr] Failed to instantiate module home-premium due to:
Error: [$injector:modulerr] Failed to instantiate module {} due to:
Error: [ng:areq] Argument 'module' is not a function, got Object

当我尝试使用角度选择时遇到相同的问题,我无法正确导入

总而言之,我需要输入angularjs,例如在问题中添加标签时出现的输入

Multiple select input example

0 个答案:

没有答案