ui-codemirror icon indicating copy to clipboard operation
ui-codemirror copied to clipboard

Unknown Provider error when using minified ui-codemirror.js

Open patlaundy opened this issue 9 years ago • 8 comments

Hi, When using the ui-codemirror directive in production (bundled and minified using ASP.NET MVC) I get the following error:

Unknown provider: nProvider <- n <- uiCodemirrorDirective

This is caused by the dependency uiCodemirrorDirective (on line 13 of ui-codemirror.js) is minified to the character 'n' and of course AngularJS does not know what to inject in.

The fix is very simple. on line 8 of ui-codemirror.js simply provide an array which states the required dependencies as strings: .directive('uiCodemirror', ['$timeout', 'uiCodemirrorConfig', uiCodemirrorDirective]);

Cheers

patlaundy avatar Sep 15 '15 02:09 patlaundy

:+1:

sim51 avatar Oct 14 '15 16:10 sim51

@patrix2001 would you please make a pull request?

legend80s avatar Oct 20 '15 04:10 legend80s

It is really helpful! Thank you!

SpinLock79 avatar Dec 01 '15 07:12 SpinLock79

Still not fixed (?)

Noppey avatar Jan 05 '17 08:01 Noppey

FWIW, I forked the repo and added the fix mentioned in this issue. See above referenced commits for how to point to the fork instead of the official repo, if you'd like.

crittermike avatar Dec 02 '17 18:12 crittermike

@mikecrittenden you saved my day. Is there a chance this added line was in the official repo?

daohodac avatar Feb 18 '18 08:02 daohodac

@daohodac I don't think so - the official repo hasn't had a commit in almost 3 years.

crittermike avatar Feb 19 '18 14:02 crittermike

Having the same problem

cnelissen avatar May 04 '18 22:05 cnelissen