code-snippets icon indicating copy to clipboard operation
code-snippets copied to clipboard

Uncaught TypeError: Cannot read property 'invoke' of undefined

Open moneytree-doug opened this issue 10 years ago • 2 comments

This code snippet wasn't working with the argument document, but it worked with document.body. https://github.com/bahmutov/code-snippets/blob/master/ng-idle-apply-timing.js

moneytree-doug avatar Apr 03 '15 07:04 moneytree-doug

I face the same problem. I use angular 1.3.

ghost avatar Dec 04 '15 08:12 ghost

This code snippet wasn't working with the argument document, but it worked with document.body. https://github.com/bahmutov/code-snippets/blob/master/ng-idle-apply-timing.js

I face the same problem. I use angular 1.3.

It doesn't work, because you should specify your ng-app element instead of document.body Just change this line: angular.element(document.body).injector().invoke(timeApply);

zavrakv avatar Sep 07 '19 10:09 zavrakv