Skip to content
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.

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

Closed
sfc-gh-rpughsley opened this issue Sep 21, 2015 · 9 comments
Closed

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

sfc-gh-rpughsley opened this issue Sep 21, 2015 · 9 comments
Labels
Milestone

Comments

@sfc-gh-rpughsley
Copy link

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 grtjn added this to the 0.2.0 milestone Sep 21, 2015
@grtjn grtjn added the bug label Sep 21, 2015
@grtjn
Copy link
Contributor

grtjn commented Sep 21, 2015

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

@hunterwilliams
Copy link
Contributor

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
Copy link
Contributor

grtjn commented Sep 23, 2015

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

@sfc-gh-rpughsley
Copy link
Author

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

@sfc-gh-rpughsley
Copy link
Author

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
Copy link
Author

closed by mistake!

@hunterwilliams
Copy link
Contributor

looking into it. relevant issue on their project -> pc035860/angular-highlightjs#26 except it seems like it supposedly fixed

@hunterwilliams
Copy link
Contributor

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
Copy link
Contributor

grtjn commented Sep 24, 2015

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

@grtjn grtjn closed this as completed in 55f8822 Sep 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants