Difficulty loading with ES6 (import)
See original GitHub issueWhat version of angular-loading-bar are you using?
0.9.0
What version of AngularJS are you using?
1.5.8
What browsers are affected?
Chrome
Please provide either a JSFiddle, Plunkr example that replicates the issue
import angularLoadingBar from 'angular-loading-bar'
angular
.module('common', [
angularLoadingBar
])
.run(function ($transitions, cfpLoadingBar) {
$transitions.onStart({}, cfpLoadingBar.start);
$transitions.onSuccess({}, cfpLoadingBar.complete);
});
I am sure this is related to using hyphens, but not sure how to make this work
Please describe the issue
Do you have any working examples with using this directive with ES6?
What did you expect to happen?
well, I was hoping it would work 😃
What actually happened?
angular.js:68 Uncaught Error: [$injector:strictdi] function($transitions, cfpLoadingBar) is not using explicit annotation and cannot be invoked in strict mode
http://errors.angularjs.org/1.5.8/$injector/strictdi?p0=function(%24transitions%2C%20cfpLoadingBar)(anonymous function) @ angular.js:68annotate @ angular.js:3952injectionArgs @ angular.js:4679invoke @ angular.js:4710(anonymous function) @ angular.js:4526forEach @ angular.js:321createInjector @ angular.js:4526doBootstrap @ angular.js:1758bootstrap @ angular.js:1779angularInit @ angular.js:1664(anonymous function) @ angular.js:31763trigger @ angular.js:3207defaultHandlerWrapper @ angular.js:3497eventHandler @ angular.js:3485
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Having trouble cleanly loading a ES6 module - Stack Overflow
I'm trying to do it with ES6 modules but can only get it to work this way: import chai from 'chai'; var should...
Read more >ES6 module loading: More complicated than you think
In order to autodetect modules in JavaScript programs, you would first have to parse the entire file. Modules need not use import ,...
Read more >ES Modules are terrible, actually - gists · GitHub
For example, you can't import ESM modules from a CommonJS file! ... realizing that that is an utterly useless feature because loading a...
Read more >Using ES6 modules for progressive enhancement - Decade City
Recently I was looking at native support for ES6 modules in the browser and it struck me that it was ideally set up...
Read more >Fwd: Are ES6 modules in browsers going to get loaded level ...
An async load will call for a module that knows--synchronously--its imports. The server can respond with the entire tree in one response. The...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just import it like this:
import 'angular-loading-bar';
angular.module(MODULE_NAME, [
'angular-loading-bar', // String!
])
It works for me perfectly
@mikeerickson ok! Can you close this issue?