cache methods: move from jQuery to AngularJS