katex-expression-ng demonstrates how to use the <katex-expression>
web component in an Angular 2+ project. This project was generated with Angular CLI version 8.1.2.
git clone https://github.com/navsgh/katex-expression-ng.git
ng serve
Navigate to http://localhost:4200/
.
-
Install
<katex-expression>
npm i --save @navsnpm/katex-expression
-
Include
CUSTOM_ELEMENTS_SCHEMA
inapp.module.ts
Refer to the comment "// for
<katex-expression>
web component" for specific linesimport { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; // for <katex-expression> web component import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule ], providers: [], // for <katex-expression> web component schemas: [CUSTOM_ELEMENTS_SCHEMA], bootstrap: [AppComponent] }) export class AppModule { }
-
Invoke
defineCustomElements
inmain.ts
Refer to the comment "// for
<katex-expression>
web component" for specific linesimport { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; // for <katex-expression> web component import { defineCustomElements as defineKatex } from '@navsnpm/katex-expression/loader'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); // for <katex-expression> web component defineKatex(window);
katex-expression-ng
is licensed under the MIT License.