How To Write Javascript In Angular You Can Pass