Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular - Use ngStrictDi with GoogleChart lib

I'm loading googleChart library in an angular application this way (in my app.js) :

// load google-chart lib before angularJS to make it work
google.setOnLoadCallback(function() {
    angular.bootstrap(document.body, ['FlexyBeautyApp']);
});
google.load('visualization', '1', {packages: ['corechart']});

So, i don't have ng-app directive in my index.html file on body element. I want to use ngStrictDi which has to be placed next this ng-app directive.

Can i write ng-strict-di without ng-app on the body, this will work fine ?

like image 985
matt2mi Avatar asked Feb 28 '26 07:02

matt2mi


1 Answers

The solution seems to be : angular.bootstrap(document.body, ['FlexyBeautyApp'],{strictDi:true});

like image 78
Sébastien Beaujard Avatar answered Mar 01 '26 19:03

Sébastien Beaujard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!