angular-moment icon indicating copy to clipboard operation
angular-moment copied to clipboard

Ionic index.html cannot find moment.js and angular-moment.js

Open daggeto opened this issue 8 years ago • 4 comments

Hi i'm getting this errors on application start in console: screen shot 2016-04-27 at 9 03 12 am Steps i do: npm install angular-moment moment --save then add this to index.html

<script src="components/moment/moment.js"></script>
<script src="components/angular-moment/angular-moment.js"></script>

I spent last night on this. Tried to install with bower. Changed lot of path combinations. What could be wrong?

daggeto avatar Apr 27 '16 06:04 daggeto

Seems like you need to install it with bower if you expect to find it inside components.

When you use npm, it is installed inside node_modules, and then you will probably need webpack or browserify to consume that.

urish avatar Apr 27 '16 08:04 urish

if installed using bower, add this instead: `

<script src="lib/moment/min/moment.min.js"></script>

<script src="lib/angular-moment/angular-moment.min.js"></script>

`

AntonioRossi avatar Apr 29 '16 18:04 AntonioRossi

Hi Antonio,

Why would you need to go to /lib, shouldn't the components be directly into the bower_components directory?

silviu-at avatar Jul 25 '16 08:07 silviu-at

@TSilviu, In your project root directory, add a new file .bowerrc, you can specify the installation directory in bower. As for me,it's { "directory":"app/libs" }, if you dont specify,default bower_components directory.

Mxxim avatar Aug 07 '16 11:08 Mxxim