gpt4 book ai didi

javascript - 如何使用 AngularJS 和 Bootstrap 将 ngTagsInput 导入到您的项目中?

转载 作者:太空宇宙 更新时间:2023-11-04 16:27:40 27 4
gpt4 key购买 nike

在尝试使用 ngTagsInput 时如何防止出现此消息?我尝试进入模块并输入:

var app = angular.module("SinglePageApplication", [ "ngRoute",  'ui.bootstrap', 'ngTagsInput']);

但是,这总是会引发以下错误。

Uncaught Error: [$injector:modulerr] Failed to instantiate module SinglePageApplication due to:
Error: [$injector:modulerr] Failed to instantiate module ngTagsInput due to:
Error: [$injector:nomod] Module 'ngTagsInput' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.5.8/$injector/nomod?p0=ngTagsInput

此外,我尝试使用此 link 安装它并调用命令:

$ npm install ng-tags-input@3.1.1 --save

但这总是会引发错误:

UNMET PEER DEPENDENCY grunt@1.0.1
└── ng-tags-input@3.1.1

我想要的只是能够使用标签输入,但是我觉得我缺少一些重要的东西来解决所有这些问题。我真的很感激任何帮助。

最佳答案

我记得遇到了一个问题,我想出的修复/解决方法是将 ng-tags-input.js 复制到本地并将其保存在 .git 中。

我完全忘记检查这一点,当时任何 Angular >= 1.5 都存在错误。无法准确记忆起该错误,但我认为我的问题是当按 Enter 键时,它会从下拉列表中选择一项,而不是提交输入。

关于javascript - 如何使用 AngularJS 和 Bootstrap 将 ngTagsInput 导入到您的项目中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40091870/

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