Search code examples
javascriptangularjsrequirejsbrowserifyamd

Arbitrary precision decimal arithmetic in angular


I'm looking to do precision decimal arithmetic in an Angular controller.

I have used the big.js module before in Node applications and would like to use it again in this instance.

It seems like I have a few options, I can use AMD / requirejs to require it (not exactly sure how though, not very familiar with requirejs), or I can link to its path.

My question though is, how can I include this javascript file to have it available to be used in my Angular controller?

If I include it is my base .html shell page, will it be available to my controller? Should I use browserify/requirejs?


Solution

  • You don't have to use require.js. Including it in the base .html page normally will make the Big constructor available for all script modules (including controllers) defined after that.