Has anyone gotten Mathjax working with Angular2 ?
Plunkr example created :- http://plnkr.co/edit/FLduwmtHfkCN5XPfzMsA?p=preview
From some Angular1 example
Based on this question, I started the development of an open source project to typeset TeX math expressions with Angular. The project is on https://github.com/garciparedes/ng-katex.
You can install the module with:
npm install ng-katex --save
To add the module to your proyect add the KatexModule to import's field of your parent module:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { KatexModule } from 'ng-katex';
@NgModule({
imports: [BrowserModule, KatexModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
class AppModule {}
platformBrowserDynamic().bootstrapModule(AppModule);
And then you can use it as follows:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: ``
})
export class AppComponent {
equation: string = ''\sum_{i=1}^nx_i'';
}