ui-codemirror
ui-codemirror copied to clipboard
Unknown Provider error when using minified ui-codemirror.js
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
:+1:
@patrix2001 would you please make a pull request?
It is really helpful! Thank you!
Still not fixed (?)
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.
@mikecrittenden you saved my day. Is there a chance this added line was in the official repo?
@daohodac I don't think so - the official repo hasn't had a commit in almost 3 years.
Having the same problem