urish / angular-moment

Moment.JS directives for Angular.JS (timeago and more)
MIT License
2.6k stars 397 forks source link

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

Open daggeto opened 8 years ago

daggeto commented 8 years ago

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?

urish commented 8 years ago

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.

AntonioRossi commented 8 years ago

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>

`

silviu-at commented 8 years ago

Hi Antonio,

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

Mxxim commented 8 years ago

@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.