pc035860 / angular-highlightjs

AngularJS directive for syntax highlighting with highlight.js
http://pc035860.github.io/angular-highlightjs/example/
MIT License
294 stars 53 forks source link

Please add dependecy injection to src file #69

Open Romick2005 opened 8 years ago

Romick2005 commented 8 years ago

Hi,

Can you please add injectors to src/angular-highlightjs.js file?

ngModule.factory('hljsCache', ['$cacheFactory', function ($cacheFactory) {

ngModule.controller('HljsCtrl', ['hljsCache', 'hljsService', '$interpolate', '$window', '$log', function HljsCtrl (hljsCache, hljsService, $interpolate, $window, $log) {

hljsDir = ['$parse', function ($parse) {

Because I am using requireJs for dynamical loading. That's why i cannot use your root angular-highlightjs.js file. Because it require hljs. But I want use for example highlightJSPath not the hljs.

pc035860 commented 8 years ago

Hi @Romick2005 ,

src/angular-highlight.js is not intended to be used in your code. Maybe a non-UMD build will do?

build/angular-highlight.non-umd.js

(function (module) {
  /* content of src/angular-highlight.js */
})(angular.module('hljs', []));