Calculate solvent residues in NMR spectrum, Angularjs version