【发布时间】:2018-01-28 00:30:38
【问题描述】:
我怎样才能使嵌套在我的 div 中的元素可以被 MathJax 更改以从 TeX 转换为 HTML。
目前我有这个 app.component.html:
<p>
When \(a \ne\) It works baby
</p>
<div class="topnav">
<input type="text" placeholder="Search..">
<div class="theoremsContainer">
<ul>
<div *ngFor="let theorem of bibleObservable | async">
<ngb-alert type="info" [dismissible]="false">
<h1>{{theorem.rule}}: {{theorem.name}}</h1>
<p>{{theorem.eq}}</p>
</ngb-alert>
</div>
</ul>
</div>
</div>
顶部的段落标签格式正确,但嵌套在带有 ngFor 标签的 div 中的定理未正确显示,而仅显示 TeX。作为参考,这是我的 app.component.ts:
import { Component, OnInit } from '@angular/core';
import { AngularFireDatabase } from 'angularfire2/database';
import { Observable } from 'rxjs/Observable';
@Component({
selector: 'app-bible',
templateUrl: './bible.component.html',
styleUrls: ['./bible.component.scss']
})
export class BibleComponent implements OnInit {
bibleObservable: Observable<any[]>;
constructor(private db: AngularFireDatabase) { }
ngOnInit() {
this.bibleObservable = this.getRule('/theorems');
}
getRule(listPath): Observable<any[]> {
return this.db.list(listPath).valueChanges();
}
}
如何让 MathJax 也改变嵌套在这个 div 中的元素?
【问题讨论】:
标签: angular typescript observable angular5 mathjax