mml-dynamic-rendering
v1.0.3
Published
How to render N number mathml tags in browser dynamically using Angular and MathJax3
Downloads
5
Readme
MMLDynamicRendering
How to render N number mathml tags in browser dynamically using Angular and MathJax3
Consider some mathemtics question papers, it includes may be more than 60 to 70 maths questions or more than that, how you going to render the N numbers of questions in same page without any performance delay in page
installation
npm i mml-dynamic-rendering
Example
.html
<div *ngFor="let question of questions;let i = index" #items></div>
.ts
import { MMLDynamicRenderingService } from 'MML-dynamic-rendering';
import { QueryList,ViewChildren } from '@angular/core';
constructor( private mathservice:MMLDynamicRenderingService){
this.data();
}
@ViewChildren('items') quest!: QueryList<any>;
We have to use @ViewChildren as we using rendering N number equation at a time instead of @ViewChild
data(){
this..render(record.nativeElement, record.data);
}
you can also call in ngAfterViewInit function, as implementing component by AfterViewInit.
this.mathService.render(record.nativeElement, record.data);