showdownjs / ng-showdown

Angular integration for Showdown
BSD 3-Clause "New" or "Revised" License
105 stars 33 forks source link

[$injector:modulerr] when including ng-showdown as module dependency #26

Closed z3ntu closed 8 years ago

z3ntu commented 8 years ago
var app = angular.module('myAngularApp', ['ngRoute', 'ngAnimate', 'ui.bootstrap', 'ng-showdown']);

When I use that line, I get an uncaught error. Everything works fine if you remove the ng-showdown from the list (except showdown does not work). I use the following list of other javascript files/libraries:

    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular-route.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular-animate.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.1/ui-bootstrap-tpls.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.3.0/showdown.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ng-showdown/1.1.0/ng-showdown.min.js"></script>
tivie commented 8 years ago

You need to include ngSanitize too

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular-sanitize.min.js"></script>
z3ntu commented 8 years ago

Great, that fixed it! I see you also added it to the readme ;) thanks!