Memoize Angular functions