<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: vinay kumar</title>
    <description>The latest articles on DEV Community by vinay kumar (@vinaymcscet).</description>
    <link>https://dev.to/vinaymcscet</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F531274%2F4c99468f-4e55-4890-b3a5-cc7ff6f699c4.jpeg</url>
      <title>DEV Community: vinay kumar</title>
      <link>https://dev.to/vinaymcscet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vinaymcscet"/>
    <language>en</language>
    <item>
      <title>write testcases for the below functions in Angular TypeScript using Jasmin-karma.</title>
      <dc:creator>vinay kumar</dc:creator>
      <pubDate>Mon, 12 Jul 2021 06:03:49 +0000</pubDate>
      <link>https://dev.to/vinaymcscet/write-testcases-for-the-below-functions-in-angular-typescript-using-jasmin-karma-14gm</link>
      <guid>https://dev.to/vinaymcscet/write-testcases-for-the-below-functions-in-angular-typescript-using-jasmin-karma-14gm</guid>
      <description>&lt;p&gt;open(): void {&lt;br&gt;
    this.isActivate = true;&lt;br&gt;
    document.body.appendChild(this.element);&lt;br&gt;
    this.element.style.display = 'block';&lt;br&gt;
    document.body.classList.add('tfb-modal-open', 'body--no-scroll');&lt;br&gt;
    setTimeout(() =&amp;gt; {&lt;br&gt;
      const focusableElements =&lt;br&gt;
        'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';&lt;br&gt;
      const modal = document.querySelector('#tfb-modal'); // select the modal by it's id&lt;br&gt;
      console.log("modal", modal);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  const firstFocusableElement = modal.querySelectorAll(focusableElements)[0] as HTMLInputElement;
  console.log("firstFocusableElement", firstFocusableElement);
  // get first element to be focused inside modal
  const focusableContent = modal.querySelectorAll(focusableElements);
  console.log("focusableContent", focusableContent);
  let lastFocusableElement: any;
  if (focusableContent.length &amp;lt;= 2) {
    lastFocusableElement = focusableContent[focusableContent.length - 2] as HTMLInputElement;
    console.log("lastFocusableElement_if", lastFocusableElement);
     // get last element to be focused inside modal
  } else {
    lastFocusableElement = focusableContent[focusableContent.length - 1] as HTMLInputElement;
    console.log("lastFocusableElement_else", lastFocusableElement);
     // get last element to be focused inside modal
  }

  document.addEventListener('keydown', (e) =&amp;gt; {
    // tslint:disable-next-line: deprecation
    const isTabPressed = e.key === 'Tab' || e.keyCode === 9;
    if (!isTabPressed) {
      return;
    }
    if (e.shiftKey) { // if shift key pressed for shift + tab combination
      if (document.activeElement === firstFocusableElement) {
        lastFocusableElement.focus(); // add focus for the last focusable element
        e.preventDefault();
      }
    } else { // if tab key is pressed
      if (document.activeElement === lastFocusableElement) {
        // if focused has reached to last focusable element then focus first focusable
        // element after pressing tab
        firstFocusableElement.focus(); // add focus for the first focusable element
        e.preventDefault();
      }
    }
  });

  firstFocusableElement.focus();
}, (1000));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hacktober Badge</title>
      <dc:creator>vinay kumar</dc:creator>
      <pubDate>Fri, 04 Dec 2020 06:39:23 +0000</pubDate>
      <link>https://dev.to/vinaymcscet/hacktober-badge-4h0e</link>
      <guid>https://dev.to/vinaymcscet/hacktober-badge-4h0e</guid>
      <description>&lt;p&gt;Hi,&lt;br&gt;
I am very much pretty excited to receive my first Hacktober Fest Badge.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
