MathJax Equation AngularJS
HTML
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&dummy=.js"></script>
<div ng-controller="MyCtrl">
<button ng-click="Update()">Update</button>
{{Label}} <span id="mathElement">{{Expression}}</span>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope, $element) {
$scope.Update = function() {
$scope.Expression = '\\frac{9}{4} \\div \\frac{1}{6}';
$scope.Label = 'Updated Expression:'
var math = MathJax.Hub.getAllJax("mathElement")[0];
math.Text('\\frac{4}{4} \\div \\frac{2}{6}');
}
$scope.Expression = '\\( \\frac{5}{4} \\div \\frac{1}{6} \\)'
$scope.Label = 'Original Expression:'
}