Struggling with these issue for past 2 days. Finally just gave a try in ChatGPT and I can't express how good it was. Im pretty sure that code which it generated is not there anywhere in Google, more specifically in stackoverflow, stackblitz.