Search code examples
javascriptcssangularjsnode.jsmean.io

Adding angular module to mean.io package


I am trying to add the angular-ui-grid module from npm (or bower) to a mean.io package:

$ cd packages/custom/mypackage
$ npm install angular-ui-grid --save

I then added this line to to packages/custom/mypackage/public/index.js

import 'angular-ui-grid';

and this line to packages/custom/mypackage/app.js

MyPackage.angularDependencies(['ui.grid']);

This seems to import the JS, but not the CSS. How do I get it to also bring in the styles?


Solution

  • just add into your index.js:

    import 'angular-ui-grid/ui-grid.min.css';

    you can see how it is done for angular-ui-select in the mean.io's app.js:

    https://github.com/linnovate/mean/blob/05c63abae72635923eda07fefeac937b4e67790e/app.js