question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Difficulty loading with ES6 (import)

See original GitHub issue

What 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:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
kurakin-oleksandrcommented, Sep 7, 2016

Just import it like this: import 'angular-loading-bar';

angular.module(MODULE_NAME, [ 'angular-loading-bar', // String! ])

It works for me perfectly

0reactions
kurakin-oleksandrcommented, Sep 8, 2016

@mikeerickson ok! Can you close this issue?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found