简体   繁体   中英

How do you import ngTagsInput into your project with AngularJS and Bootstrap?

How do you prevent this message while trying to use ngTagsInput? I tried to go to the module and put in:

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

However, this always throws the following error below.

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

Additionally, I trying to install it, using this link and calling the command:

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

But this always throws the error:

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

All I want is to be able to use the tags-input, however I feel I am missing something major to have all of these issue. I would really appreciate any help.

I remember running into an issue with this and the fix/workaround I came up with was to copy the ng-tags-input.js locally and keep it within .git.

I had totally forgotten to check up on this, at the time there was a bug with any Angular >= 1.5. Can't recall the bug exactly but I think my issue was when hitting enter it would select one of items from the dropdown rather than submitting the input.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM