marklogic-community / slush-marklogic-node

Slush generator for a MarkLogic/node project
https://github.com/marklogic-community/slush-marklogic-node/wiki
Other
40 stars 28 forks source link

Unable to display xml data when using hljs in detail.html #210

Closed sfc-gh-rpughsley closed 9 years ago

sfc-gh-rpughsley commented 9 years ago

I'm using some XML data and want to display the content when selected from a search. In previous iterations of slush-marklogic-node I made the following change to detail.html:

<div class="row detail">
  <!-- display JSON data
  <json-explorer data="model.detail"></json-explorer>-->
  <div hljs source="model.detail" language="xml"></div>
</div>

and added hljs to app.js, but this does not work with the latest version of slush-marklogic-node I am using (0.2.0), with no output being displayed. The code I used is:

<div class="panel-body">
    <div hljs source="ctrl.doc" language="xml"></div>
</div>

but I did manage to get this working:

<div class="panel-body">
    <pre>{{ctrl.doc}}</pre>
</div>
grtjn commented 9 years ago

We are shipping hljs as a bower dependency by default, and it is commonly used as well..

hunterwilliams commented 9 years ago

Did the component properly add to index.html? Also any console errors? Not familiar with how to set this up to recreate the issue

grtjn commented 9 years ago

There was a console message deep inside highlightjs about some missing function. @robpml, can you recover that message, and add here?

sfc-gh-rpughsley commented 9 years ago

sorry meant to include it originally - will recreate and update the case shortly..

sfc-gh-rpughsley commented 9 years ago

Console output:

TypeError: Cannot read property 'configure' of undefined
    at Object.$get (http://localhost:3000/bower_components/angular-highlightjs/build/angular-highlightjs.js:47:12)
    at Object.invoke (http://localhost:3000/bower_components/angular/angular.js:4476:17)
    at http://localhost:3000/bower_components/angular/angular.js:4293:37
    at getService (http://localhost:3000/bower_components/angular/angular.js:4435:39)
    at Object.invoke (http://localhost:3000/bower_components/angular/angular.js:4467:13)
    at extend.instance (http://localhost:3000/bower_components/angular/angular.js:9127:34)
    at nodeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8239:36)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:7671:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:7675:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:7675:13) <ui-view class="ng-scope">
sfc-gh-rpughsley commented 9 years ago

closed by mistake!

hunterwilliams commented 9 years ago

looking into it. relevant issue on their project -> https://github.com/pc035860/angular-highlightjs/issues/26 except it seems like it supposedly fixed

hunterwilliams commented 9 years ago

so confirmed that it was what the last comment on that issue is. basically our dependencies get out of order and highlights.js is being added after angular-highlights.js which is causing this error. normally this isn't an issue but since there is no official highlightjs bower component angular-highlights doesn't specify a dependency so the order is not ensured...

grtjn commented 9 years ago

Ah, so bower overrides could indeed fix this. We could do both though, put angular-* at bottom, and add a bower override..