btford/angular-markdown-directive

Directive isn't minification-proof

leehsueh opened this issue · 8 comments

When including the directive and compressing/minifying it, the resulting js file cannot find/compile the directive. The resulting error is:

Error: [$injector:unpr] Unknown provider: aProvider <- a <- btfMarkdownDirective

To fix this, the directive needs to be defined with the array syntax:

directive('btfMarkdown', ['$sanitize', function ($sanitize) {...}])

Or, as suggested in the style guide with

... directive('btfMarkdown', btfMarkdownDirective)
...

btfMarkdownDirective.$inject = ['$sanitize'];

function btfMarkdownDirective($sanitize) { ... }

+1

Any update on this issue, still not fixed?

Has a PR been opened for this?

Yes there's a PR passing tests here: #24

Closed via #24.