Focus not working from Side menu

Hello everyone,

I’m trying to set focus to first field in form when user clicks option from side menu. But, it is not working when I clicked item from side menu and it is working only when i’m clicking icon from dashboard page.

Here is the code I’m using

Home Counting Test1 Test 2

When I clicked test 1 form displays but focus was not set. Below is the code I’m using to set focus.

$timeout(function () {
}, 0);