Common files used in both [ng-admin](https://github.com/marmelab/ng-admin) and [react-admin](https://github.com/marmelab/react-admin).
npm install admin-configCommon files used in both ng-admin and react-admin.
``sh`
make install
Require whatever class you need directly.
`js`
// es5
var NumberField = require('admin-config/lib/Field/NumberField');
// es6
import NumberField from "admin-config/lib/Field/NumberField";
Admin-config is written in ES6. You'll need a transpiler to use any of the classes (we recommend Webpack and babel). Here is an example Webpack configuration:
`js`
module.exports = {
// ...
module: {
loaders: [
{ test: /node_modules\/admin-config\/.*\.js$/, loader: 'babel' }
]
}
};
In order to increase this library compatibility and to not force other users of this
library to use Babel, you need to transpile your ES6 code from src/ to good old ES5lib/
code (in ).
Just run:
` sh`
make transpile
And you are done!
`sh``
make test