Figuring out function calls using RCall (angular js)