Skip to content

Commit

Permalink
fix(demo): code examples highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastrajan committed Jul 31, 2020
1 parent 9c5aee2 commit 9996908
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"@angular/pwa": "^0.1000.0",
"@angular/router": "^10.0.1",
"@angular/service-worker": "^10.0.1",
"highlight.js": "^10.1.1",
"ngx-highlightjs": "^4.1.0-beta",
"highlight.js": "^9.0.0",
"ngx-highlightjs": "^4.1.1",
"rxjs": "^6.5.5",
"tslib": "^2.0.0",
"zone.js": "^0.10.3"
Expand Down
13 changes: 5 additions & 8 deletions projects/elements-demo/src/app/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ import { ToolbarComponent } from './layout/toolbar/toolbar.component';
import { NavigationComponent } from './layout/navigation/navigation.component';
import { FooterComponent } from './layout/footer/footer.component';

export function hljsLanguages() {
return {
typescript: () => import('highlight.js/lib/languages/typescript'),
xml: () => import('highlight.js/lib/languages/xml'),
};
}

@NgModule({
declarations: [ToolbarComponent, NavigationComponent, FooterComponent],
imports: [
Expand All @@ -29,7 +22,11 @@ export function hljsLanguages() {
{
provide: HIGHLIGHT_OPTIONS,
useValue: {
languages: hljsLanguages(),
coreLibraryLoader: () => import('highlight.js/lib/highlight'),
languages: {
typescript: () => import('highlight.js/lib/languages/typescript'),
xml: () => import('highlight.js/lib/languages/xml'),
},
},
},
],
Expand Down

0 comments on commit 9996908

Please sign in to comment.