0
votes

I'm adding ag-grid to an angular app created with angular-fullstack yeoman generator. it uses ES6, so i have to use "import" syntax in my app.js i installed with npm:

npm install ag-grid --save

then added an import line in app.js as mentioned in the get-started:

import {Grid} from 'ag-grid/main';

then in i added the new "Grid" to my list of modules, like this

angular.module('app', [ngCookies, ngResource, ngSanitize, uiRouter, uiBootstrap, _Auth, account, admin, navbar, footer, main, Grid ])

Then i get an error in my chrome console:

angular.js:68Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: Error: [$injector:modulerr] Failed to instantiate module function Grid(eGridDiv, gridOptions, params) due to: Error: [$injector:strictdi] Grid is not using explicit annotation and cannot be invoked in strict mode http://errors.angularjs.org/1.5.8/$i...di?p0=Grid at http://localhost:3000/vendor.bundle.js:194:13 at Function.annotate [as $$annotate] (http://localhost:3000/vendor.bundle.js:4078:18) at injectionArgs (http://localhost:3000/vendor.bundle.js:4805:37) at Object.invoke (http://localhost:3000/vendor.bundle.js:4836:19)

Does anybody know how to solve this? Thank you.

2

2 Answers

0
votes

Although I'm not sure that this will in fact help, try this:

var module = angular.module("app", ["agGrid",...the rest of your dependencies]);
0
votes

I think you need to call

import {initialiseAgGridWithAngular1} from 'ag-grid/main';
initialiseAgGridWithAngular1();