MurhafSousli / ngx-highlightjs

Angular syntax highlighting module
https://ngx-highlight.netlify.app/
MIT License
278 stars 35 forks source link

Need a help #49

Closed askarmus closed 6 years ago

askarmus commented 6 years ago

I followed the https://stackblitz.com/edit/ngx-highlightjs-all?file=styles.css sample, but I get the bellow error

Error details core.js:1448 ERROR TypeError: Object(...) is not a function at HighlightDirective.highlightChildren (ngx-highlightjs.js:269) at HighlightDirective.highlightTextContent (ngx-highlightjs.js:239) at SafeSubscriber.eval [as _next] (ngx-highlightjs.js:218) at SafeSubscriber.__tryOrUnsub (Subscriber.js:238) at SafeSubscriber.next (Subscriber.js:185) at Subscriber._next (Subscriber.js:125) at Subscriber.next (Subscriber.js:89) at SafeSubscriber.__tryOrUnsub (Subscriber.js:239) at SafeSubscriber.next (Subscriber.js:186) at TakeSubscriber._next (take.js:83)

Package jsosn { "name": "angular-template", "description": "", "dependencies": { "@agm/core": "^1.0.0-beta.3", "@angular/animations": "5.2.9", "@angular/cdk": "5.2.4", "@angular/common": "5.2.9", "@angular/compiler": "5.2.9", "@angular/core": "5.2.9", "@angular/flex-layout": "5.0.0-beta.13", "@angular/forms": "5.2.9", "@angular/http": "5.2.9", "@angular/material": "5.2.4", "@angular/platform-browser": "5.2.9", "@angular/platform-browser-dynamic": "5.2.9", "@angular/platform-server": "^5.2.9", "@angular/router": "5.1.1", "@ngx-progressbar/core": "^4.3.0", "@types/quill": "^1.3.6", "angular2-text-mask": "^8.0.5", "classlist.js": "1.1.20150312", "core-js": "2.4.1", "ngx-highlightjs": "^2.1.1", "ngx-image-cropper": "^0.2.5", "quill": "^1.3.6", "rxjs": "5.5.2", "web-animations-js": "2.3.1", "zone.js": "0.8.12" }, "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "devDependencies": { "@angular/cli": "1.6.7", "@angular/compiler-cli": "^5.0.0", "@angular/language-service": "^5.0.0", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "~3.0.1", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.0.4", "tslint": "~5.3.2", "typescript": "~2.4.2" } }

Here id my code Module import { HighlightModule } from 'ngx-highlightjs'; HighlightModule.forRoot({ theme: 'default' }),

Component

code = `

Using highlight="all"

First code

      
function myFunction() {
  document.getElementById("demo1").innerHTML = "Hello there!";
  document.getElementById("demo2").innerHTML = "How are you?";
}
      
    

Second code

      
.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container {
  flex: 1;
  margin: 1em;
  position: relative;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}     
      
    

`;

MurhafSousli commented 6 years ago

This is not how you open an issue, Please be more specific, follow the issue template, use a proper title and add your reproduction stackblitz so I can help you

askarmus commented 6 years ago

thanks for the help