Doesn't Play Well With Bower
Opened this issue · 1 comments
Kenkron commented
I'm using bower, and as expected, bower install ngclipboard --save
installs ngclipboard, and it's dependency, clipboard. However, when loaded with these tags:
<script type="text/javascript" src="./bower/angular/angular.js"></script>
<script type="text/javascript" src="./bower/angular-aria/angular-aria.min.js"></script>
<!--etc.-->
<script type="text/javascript" src="./bower/clipboard/dist/clipboard.min.js"></script>
<script type="text/javascript" src="./bower/ngclipboard/dist/ngclipboard.js"></script>
It produces this in the console:
WARNING: Tried to load angular more than once.
module.js:455 Uncaught Error: Cannot find module 'clipboard'
Referencing this code:
// Check for CommonJS support
if (typeof module === 'object' && module.exports) {
angular = require('angular');
Clipboard = require('clipboard'); //this line in particular
module.exports = MODULE_NAME;
} else {
angular = window.angular;
Clipboard = window.Clipboard;
}
If I install using npm, it all works, even if I keep the bower source tags.
The project has node packages in the same directory, including angular, which explains why the log says WARNING: Tried to load angular more than once.
instead of something like module.js:454 Uncaught Error: Cannot find module 'angular'
.