<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pradeep Singh Rawat on Medium]]></title>
        <description><![CDATA[Stories by Pradeep Singh Rawat on Medium]]></description>
        <link>https://medium.com/@pradeepsr?source=rss-3ce58953fff9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dYqF3ti4WWgZzFZM3zDESg.jpeg</url>
            <title>Stories by Pradeep Singh Rawat on Medium</title>
            <link>https://medium.com/@pradeepsr?source=rss-3ce58953fff9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 11:12:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pradeepsr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Discover Love the Uttarakhandi Way — PahadiRishta.com]]></title>
            <link>https://medium.com/pahadirishta/discover-love-the-uttarakhandi-way-pahadirishta-com-a1ed891a4d02?source=rss-3ce58953fff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1ed891a4d02</guid>
            <category><![CDATA[matrimony-sites]]></category>
            <category><![CDATA[matrimony]]></category>
            <category><![CDATA[love]]></category>
            <category><![CDATA[weddings]]></category>
            <category><![CDATA[uttarakhand]]></category>
            <dc:creator><![CDATA[Pradeep Singh Rawat]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 16:07:25 GMT</pubDate>
            <atom:updated>2023-10-25T16:09:09.097Z</atom:updated>
            <content:encoded><![CDATA[<h3>Discover Love the Uttarakhandi Way — PahadiRishta.com</h3><p>Welcome to <a href="https://pahadirishta.com/">PahadiRishta.com</a>, where love knows no boundaries! Our mission is simple — to connect hearts, break barriers, and foster love in the true spirit of Uttarakhand. Join us for a journey that transcends borders and languages, all while remaining absolutely free. Start your quest for love today!</p><h3>Know More PahadiRishta.com</h3><p><a href="https://pahadirishta.com/">PahadiRishta.com</a>: Your Trusted Uttarakhand Matrimonial Site</p><p>Welcome to <a href="https://pahadirishta.com/">PahadiRishta.com</a>, the premier online matrimonial platform dedicated to the beautiful landscapes and diverse cultures of Uttarakhand. As the trusted and top-rated matrimony site serving the heartlands of Garhwali and Kumaoni communities, we take immense pride in fostering lasting relationships that are as strong and enduring as the enchanting surroundings of Uttarakhand.</p><p>Our mission at PahadiRishta.com is to connect hearts, bridge distances, and unite souls in the captivating realm of Uttarakhand. With a deep understanding of the unique traditions, values, and aspirations of the region, we have curated a matrimonial experience that celebrates the rich tapestry of Uttarakhandi culture.</p><figure><img alt="PahadiRishta app" src="https://cdn-images-1.medium.com/max/1024/1*zm3NekQmFSYYyTGK6KirMA.jpeg" /></figure><h3>How to Register?</h3><h3>Step 1: Visit Our Website</h3><p>Go to the PahadiRishta.com website<a href="https://pahadirishta.com/"> (www.pahadirishta.com) </a>using your preferred web browser.</p><h3>Step 2: Fill Details</h3><p>Complete the registration form by providing essential details required information.</p><h3>Step 3: Verify Your Profile</h3><p>Our dedicated team will carefully verify your profile. This crucial step enhances the security of your account.</p><p>That’s it! You’re now registered on PahadiRishta.com and ready to begin your journey to find the perfect match amidst the beauty of Uttarakhand. Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1ed891a4d02" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pahadirishta/discover-love-the-uttarakhandi-way-pahadirishta-com-a1ed891a4d02">Discover Love the Uttarakhandi Way — PahadiRishta.com</a> was originally published in <a href="https://medium.com/pahadirishta">PahadiRishta</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Lazy-Loading Router-Outlets: Named Router Outlets in Angular (Auxiliary Routes)]]></title>
            <link>https://medium.com/time-machine/lazy-loading-router-outlets-named-router-outlets-in-angular-auxiliary-routes-b7eee6c79a53?source=rss-3ce58953fff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7eee6c79a53</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Pradeep Singh Rawat]]></dc:creator>
            <pubDate>Fri, 19 Jun 2020 17:03:37 GMT</pubDate>
            <atom:updated>2022-01-04T09:49:07.764Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lazy-Loading Router-Outlets: Named Router Outlets in Angular (Auxiliary Routes)</h3><blockquote>Basically, in this <strong>Blog</strong>, we will discuss about the lazy-loading of multiple pop-up websites like Instagram.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*eqzv2nKlKbbJEE7uKFuZpQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@mattseymour?utm_source=medium&amp;utm_medium=referral">Matt Seymour</a></figcaption></figure><blockquote><strong>Description</strong></blockquote><p>Angular fully supports the concept of auxiliary routes, <strong>Which allows you to create multiple routes on the same page in a single page application. Each component has a primary route and zero or multiple auxiliary outlets.</strong> And the <strong>unique</strong> name <em>(&lt;router-outlet name=”unique-name”&gt;)</em> is <strong>required</strong> in auxiliary outlets.</p><p>The first thing we have to keep in mind is that we have to do the configuration of simple routing. In which Auxiliary Routeing will be displayed. | Once the router has a URL match, it will try to display the corresponding matching components. for that it will look in the template for a router-outlet component:</p><blockquote><strong>Why should we use Auxiliary Routes?</strong></blockquote><p>There are some reasons for using auxiliary routes. Which improves your application and allows the user to enjoy a better experience without using low internet. It fully supports the concept of load time.</p><ol><li>The <strong>load time</strong> of the modules can be <strong>reduced</strong>. Through which a better user experience can be obtained.</li><li>If you don’t want a URL like <em>(aux-name: aux)</em>, angular gives us the option of <strong>skipLocationChange</strong>. Which gives the feel of a dialog box open and closed.</li><li>With Auxiliary Routes, <strong>we can open multiple popups with lazy-loading</strong>. Which will make the load time of our parent modules work.</li><li><strong><em>We can call the routing of auxiliary-outlets from anywhere.</em></strong> Which is good news.</li></ol><blockquote><strong>Goal: The dialog box with lazy-loading</strong></blockquote><p>For example, if I say to click on a button, the dialog box of the settings has to be open and there will be multiple routes inside it. And the<strong> chunk of the settings dialog box should be loaded in run time</strong>.</p><p>The goal is to make a dialog box like Instagram and lazy-loading it. Which will have multiple routes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vfd7PqENkOzIlIMfbW794A.png" /><figcaption>This is our goal</figcaption></figure><blockquote><strong>Setup</strong></blockquote><p>Basically in <strong><em>app-routing.ts,</em></strong> we have created an outlet: ‘auxName’. In which our setting dialog box will be open. And in <strong><em>app.component.html</em></strong> we have declared that <strong><em>outlet </em>(<em>&lt;router-outlet name=”auxName”&gt;&lt;/router-outlet&gt;</em>)</strong> because we have to open the dialog box at the outside.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ef58792321fe157df2437f8800000a2/href">https://medium.com/media/9ef58792321fe157df2437f8800000a2/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c1832f91e78a29c8860be1167a3a067/href">https://medium.com/media/4c1832f91e78a29c8860be1167a3a067/href</a></iframe><p>When the <strong><em>OPEN SETTING</em></strong> button is clicked while home.component.html is in the file. FUNCTION CALL →<strong>changeRoute()</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/154/1*EExngF4TDXXJMtALlBAWmQ.png" /></figure><blockquote><strong><em>skipLocationChange → </em></strong>We do not have to show the routing of the outlet in the URL. 😀</blockquote><pre><strong> //Click on OPEN SETTING FROM home.component<br></strong>changeRoute() {<br>    this._router.navigate([&#39;&#39;, { outlets: { auxName: &#39;aux&#39; }, }], { skipLocationChange: skipUrlChange })<br>  }</pre><blockquote><strong><em>CODE END</em></strong> → Let’s start the final code.</blockquote><p>Here we have auxiliary Routing module <strong><em>(auxiliary-routing.module.ts)</em></strong> and HTML file <strong><em>(Auxiliary.component.html)</em></strong>. Which we designed like a dialog box. And in that design, there is a router-outlet that will open multiple child routing like(<em>EditProfile, Change-password, activity ect..</em>).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b20858b56ea1c8d1f3b1be98f7049f05/href">https://medium.com/media/b20858b56ea1c8d1f3b1be98f7049f05/href</a></iframe><blockquote><em>Auxiliary.component.html</em></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21166ef8bbcea7bf0cc90ed25fed7bc9/href">https://medium.com/media/21166ef8bbcea7bf0cc90ed25fed7bc9/href</a></iframe><blockquote><strong><em>To close the outlet, insert a null value in the outlet. →</em></strong></blockquote><pre>closePopup() {<br>    this._router.navigate([&#39;&#39;, { outlets: { auxName: null } }])<br>  }</pre><blockquote><strong>Let’s run the code</strong>.</blockquote><p>You can see here that chunk is loading in runtime, which shows the importance of the <strong>outlets</strong> feature. <strong>#AuxiliaryRoutes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*YEW8JF2EDzpF_yp7JhiNYQ.gif" /><figcaption>Amazing.</figcaption></figure><blockquote><strong>Github Repo: </strong><a href="https://github.com/pradeepsrawat029/auxiliaryRoutes">https://github.com/pradeepsr029/auxiliaryRoutes</a></blockquote><blockquote><strong>Live Demo (V1): </strong><a href="https://stackblitz.com/edit/shiva-auxiliary-routes">https://stackblitz.com/edit/shiva-auxiliary-routes</a></blockquote><blockquote><strong>Please click on </strong>👏<strong> or </strong>Follow me on <a href="https://medium.com/@pradeepsr029"><strong>Medium</strong></a> or <a href="https://in.linkedin.com/in/pradeepsr029"><strong>Linkedin</strong></a> to read more about Angular and Javascript, Pradeep and JS! #share</blockquote><h3>Some advanced things</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qQ9y8uYi1ru4g709" /><figcaption>Photo by <a href="https://unsplash.com/@billetto?utm_source=medium&amp;utm_medium=referral">Billetto Editorial</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote><strong>Some questions come to mind when you use Auxiliary Routes.</strong></blockquote><ul><li>How to do lazy-loading in Auxiliary Routes?</li><li>How to handle multiple child routes in Auxiliary Routes?</li><li><em>How is </em><strong><em>Data Pass</em></strong><em> in Auxiliary Routes or Ext? Ext? Ext.?</em></li></ul><blockquote>We have already discussed about <strong>lazy-loading</strong> and <strong>multiple child routes</strong>.</blockquote><blockquote><strong><em>How is Data Pass in Auxiliary Routes ?</em></strong></blockquote><p>By the way, there are many ways to <em>send Passing</em>, out of which I will mention a few.</p><ul><li>Data can be shared through <strong>services</strong>.</li><li>Data can be sent through the <strong>BehaviorSubject </strong>of<strong> Rxjs</strong>.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e1fbeaa0366a858622a58e35eff265d/href">https://medium.com/media/9e1fbeaa0366a858622a58e35eff265d/href</a></iframe><ul><li>If you want to send some limited data like ID, name then it can be sent in query-params.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3aa0d26537328c9e09c8bdab5ed81103/href">https://medium.com/media/3aa0d26537328c9e09c8bdab5ed81103/href</a></iframe><ul><li>If you have <strong>secure data</strong> that you <em>cannot share with the user</em>, then you can send <strong><em>data</em></strong> in routing.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d82a2877880ce383dd586e75fae5a30b/href">https://medium.com/media/d82a2877880ce383dd586e75fae5a30b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*r-Bh9U1wEWEa8-Wtet2TEw.png" /><figcaption>Console.log value</figcaption></figure><p>So in finally <strong>advanced things</strong> we have learned about how to data pass. There are many ways to send data, we got you exposed to some main things.</p><blockquote><strong>Conclusion →</strong></blockquote><p>Thank you for reading this article. I hope you have enjoyed reading about <strong>Auxiliary Routes</strong>, while I hope you have a lot has been learned from just reading this article, and I hope you will try it yourself. This will give you more clarity. If you feel that something else should be added to it, then share it in the comment box below. (<strong>#MeetsYouAgain</strong>)</p><p><strong>Special thanks</strong> 🙏 to some person 👨 who supported me in correcting the mistakes of this article.</p><blockquote><strong>Please click on </strong>👏<strong> or </strong>Follow me on <a href="https://medium.com/@pradeepsr029"><strong>Medium</strong></a> or <a href="https://in.linkedin.com/in/pradeepsr029"><strong>Linkedin</strong></a> to read more about Angular and Javascript, Pradeep and JS! #share</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7eee6c79a53" width="1" height="1" alt=""><hr><p><a href="https://medium.com/time-machine/lazy-loading-router-outlets-named-router-outlets-in-angular-auxiliary-routes-b7eee6c79a53">Angular Lazy-Loading Router-Outlets: Named Router Outlets in Angular (Auxiliary Routes)</a> was originally published in <a href="https://medium.com/time-machine">Time Machine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Image orientation on the Website | Time Machine]]></title>
            <link>https://medium.com/time-machine/image-orientation-on-the-website-time-machine-63b5ee105d0a?source=rss-3ce58953fff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/63b5ee105d0a</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[orientation]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Pradeep Singh Rawat]]></dc:creator>
            <pubDate>Sat, 22 Feb 2020 16:10:11 GMT</pubDate>
            <atom:updated>2022-01-04T09:51:18.060Z</atom:updated>
            <content:encoded><![CDATA[<h3>Image orientation on the Website</h3><p>Especially when we take pictures from a DSLR camera 📷, then this problem is seen. If we see the picture taken from the DSLR camera 📷 on our website then its behavior changes and if we see that image in our system or mobile gallery 📱 then its behavior will be seen correctly. Let’s start with why this happens?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*_-HXl2S3Kz2PjM_k7gCgMA.jpeg" /></figure><blockquote>Looking at the image, it opens fine in the browser and using Picture Viewer of Windows as well as in Preview of Mac very much normal. Then something crazy happened. In Chrome, when I tried to include it using the &lt;img /&gt; tag, then the magic happened. The image got rotated itself along with others. The funny part was, none of my images were rotated.</blockquote><blockquote><strong><em>Need your support </em></strong>👏<strong><em> </em></strong>Follow me on <a href="https://medium.com/@pradeepsr029"><strong>Medium</strong></a> <strong>#</strong>Time Machine to read more about Angular and Javascript, <strong>Time Machine</strong> and JS!</blockquote><h3>Let’s go to our pointer as to why this happens.</h3><p>You are most probably a browser on iOS if you see the word top actually at the top and another browser if you see the word top on the left. The reason for this is that the EXIF data for this image has the info <em>Rotate 90 CW</em> for orientation.</p><p>When you embed the image using &lt;img&gt;, or background-image the image will be shown wrong in all browsers, except browsers on iOS. If you, however, open the image directly it will be shown correctly in Firefox, Chrome, and Safari, but will still be shown wrong rotated in Edge and Internet Explorer. What a great consistency!</p><h3>The image-orientation property #</h3><p>When looking for possible ways to fix orientation using CSS or JavaScript I found about the image-orientation property.</p><p>At the moment this property is only supported in Firefox and you can use it this way so browsers honor the EXIF data and <em>fix</em> the orientation:</p><pre>img {<br>    image-orientation: from-image;<br>}</pre><blockquote><em>But this property does not yet support other browsers</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYELH0WitA2zeKHDCPhNAA.png" /></figure><h3>Let’s go to the code now</h3><blockquote>#Getting Image Orientation</blockquote><pre>  async getImageOrientation(file: File, type?: string) {<br>    let changeImageType = `image/${type ? type : &#39;jpeg&#39;}`;<br>    this.orientation = 2;<br>    this.returnObject = {<br>      base64: &quot;&quot;,<br>      file: file<br>    }<br><br>    return new Promise(async (resolve, reject) =&gt; {<br>      await this.fileReadAsArrayBufferWithGetOrientation(file).then((orientation: any) =&gt; {<br>        this.orientation = orientation;<br>      });<br><br>      await this.setImageOrientationByCanvas(file, this.orientation).then((base64: any) =&gt; {<br>        fetch(base64).then(res =&gt; res.blob()).then(blob =&gt; {<br>          const file = new File([blob], `${+new Date()}.${type ? type : &#39;jpg&#39;}`, { type: changeImageType });<br>          this.returnObject = {<br>            base64: base64,<br>            file: file<br>          }<br>          resolve(this.returnObject);/*--hero object return-*/<br>        })<br>      })<br>    })<br>  };</pre><pre>async fileReadAsArrayBufferWithGetOrientation(file: File) {<br>    return new Promise((resolve, reject) =&gt; {<br>      let reader = new FileReader();<br>      reader.onload = (event: any) =&gt; {<br>        let view = new DataView(event.target.result);<br>        if (view.getUint16(0, false) != 0xFFD8) {<br>          resolve(-2)<br>          return;<br>        }<br><br>        let length = view.byteLength,<br>          offset = 2;<br>        while (offset &lt; length) {<br>          let marker = view.getUint16(offset, false);<br>          offset += 2;<br><br>          if (marker == 0xFFE1) {<br>            if (view.getUint32(offset += 2, false) != 0x45786966) {<br>              resolve(-1)<br>              return;<br>            }<br>            let little = view.getUint16(offset += 6, false) == 0x4949;<br>            offset += view.getUint32(offset + 4, little);<br>            let tags = view.getUint16(offset, little);<br>            offset += 2;<br><br>            for (let i = 0; i &lt; tags; i++) {<br>              if (view.getUint16(offset + (i * 12), little) == 0x0112) {<br>                resolve(view.getUint16(offset + (i * 12) + 8, little));<br>                return<br>              }<br>            }<br>          }<br>          else if ((marker &amp; 0xFF00) != 0xFF00) {<br><br>          } else {<br>            offset += view.getUint16(offset, false);<br>          }<br>        }<br>        resolve(-1);<br>        return<br>      };<br>      reader.readAsArrayBuffer(file.slice(0, 64 * 1024));<br>    })<br>  }</pre><blockquote>Change image Orientation by canvas</blockquote><pre>/**<br>   * @param file  {upload file}<br>   * @param srcOrientation {2,3,4,5,6,7,8}<br>   */<br>  async setImageOrientationByCanvas(file: File, srcOrientation: number) {<br>    return new Promise((resolve, reject) =&gt; {<br>      var reader = new FileReader();<br>      reader.onloadend = (e: any) =&gt; {<br>        var img = new Image();<br>        img.onload = (e: any) =&gt; {<br>          var width = img.width,<br>            height = img.height,<br>            canvas = document.createElement(&#39;canvas&#39;),<br>            ctx = canvas.getContext(&quot;2d&quot;);<br><br>          // set width by Orientation<br>          if (4 &lt; srcOrientation &amp;&amp; srcOrientation &lt; 9) {<br>            canvas.width = height;<br>            canvas.height = width;<br>          } else {<br>            canvas.width = width;<br>            canvas.height = height;<br>          }<br><br>          // transform context before drawing image<br>          switch (srcOrientation) {<br>            case 2: ctx.transform(-1, 0, 0, 1, width, 0); break;<br>            case 3: ctx.transform(-1, 0, 0, -1, width, height); break;<br>            case 4: ctx.transform(1, 0, 0, -1, 0, height); break;<br>            case 5: ctx.transform(0, 1, 1, 0, 0, 0); break;<br>            case 6: ctx.transform(0, 1, -1, 0, height, 0); break;<br>            case 7: ctx.transform(0, -1, -1, 0, height, width); break;<br>            case 8: ctx.transform(0, -1, 1, 0, 0, width); break;<br>            default: break;<br>          }<br><br>          // draw image<br>          ctx.drawImage(img, 0, 0);<br>          resolve(canvas.toDataURL());/*--hero base64 return*/<br>        };<br>        img.src = e.target.result;<br>      };<br>      reader.readAsDataURL(file);<br>    });<br>  };</pre><p><a href="https://github.com/pradeepsrawat029/imageOrientation">pradeepsrawat029/imageOrientation</a></p><blockquote><strong><em>Please click on </em></strong>👏<strong><em> or </em></strong>Follow me on <a href="https://medium.com/@pradeepsrawat029">Medium</a>, #<a href="https://medium.com/time-machine">Time Machine</a> or <a href="https://in.linkedin.com/in/pradeepsr029"><em>Linkedin</em></a><em> </em>to read more about Angular and Javascript, Pradeep and JS!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63b5ee105d0a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/time-machine/image-orientation-on-the-website-time-machine-63b5ee105d0a">Image orientation on the Website | Time Machine</a> was originally published in <a href="https://medium.com/time-machine">Time Machine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TrackBy With ngFor Directive In Angular Application— Improving your website performance]]></title>
            <link>https://medium.com/time-machine/trackby-with-ngfor-directive-in-angular-application-improving-your-website-performance-c311f375cb6a?source=rss-3ce58953fff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c311f375cb6a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[trackby]]></category>
            <dc:creator><![CDATA[Pradeep Singh Rawat]]></dc:creator>
            <pubDate>Sat, 18 Jan 2020 19:51:17 GMT</pubDate>
            <atom:updated>2020-06-14T17:21:40.866Z</atom:updated>
            <content:encoded><![CDATA[<h3>Trackby With ngFor Directive In Angular Application — Improving your website performance</h3><blockquote>Multiple time dom manipulating has become a discussion issue in single-page applications. how to stop multiple times dom manipulating?. how to improve my website performance?. how to ? how to ? how to ? how to …………</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ASTqVfA1hV-oqA2P9JvnjQ.jpeg" /><figcaption>frustrated</figcaption></figure><p><strong>So we can improve to a great extent with trackby features.</strong></p><p>The trackby feature of Angular is a very important feature.<br>A trackby Angular runs itself which is inbuilt in it. we can override it.<br>The<strong> trackby index</strong> is different and <strong>trackby unique identification</strong> (like id) is different. <em>Both behave differently in the DOM.</em></p><blockquote>TrackBy</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*fK6dJplhstxo96Zgq2t4Tw.jpeg" /><figcaption>Angular *ngFor Demo Image</figcaption></figure><p>Whenever new data comes from the server. Angular every time it becomes a new dom. Even if it is the same data.</p><blockquote><strong>TrackBy Index</strong> →The trackby will run correctly until the array’s index is changed. As soon as the index of the array changes, it will again do a complete dom manipulating.</blockquote><blockquote><strong>trackby unique identity (id)</strong> → This is a good feature to prevent your DOM from rendering multiple times. If the same data comes from the server, it updates it and does not create a new dom.</blockquote><blockquote>Normal V/S trackby Index →see demo</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yv--rxKVqXidgKqvADqQUA.png" /></figure><pre>newHttpData = [<br>    { name: &quot;Ayush KB&quot;},<br>    { name: &quot;Karma Sharma&quot;},<br>    { name: &quot;Meena Toma&quot;},<br>    { name: &quot;Dock Mark&quot;},<br>    { name: &quot;Other Team&quot;},<br>  ]<br><br>  existing= [<br>    { name: &quot;Ayush KB&quot;},<br>    { name: &quot;Karma Sharma&quot;},<br>    { name: &quot;Meena Toma&quot;},<br>  ];<br><br>  trackByFnIndex(index, item) {<br>    return index<br>  }<br><br>  refresh() {<br>    this.existing=JSON.parse(JSON.stringify(this.newHttpData));<br>  }</pre><blockquote>trackby index V/S trackby <strong>unique identity (id) → </strong>see demo</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDurh33LbRmlM37zBfsgBw.png" /></figure><pre>existing = [<br>    { name: &quot;Ayush KB&quot;, id: 1 },<br>    { name: &quot;Karma Sharma&quot;, id: 2 },<br>    { name: &quot;Meena Toma&quot;, id: 3 },<br>    { name: &quot;Dock Mark&quot;, id: 4 },<br>    { name: &quot;Other Team&quot;, id: 5 },<br>  ];<br><br>  trackByFnIndex(index, item) {<br>    return index<br>  }<br><br>  trackByFn(index, item) {<br>    return item.id<br>  }<br><br>  deletElement(){<br>    this.existing.splice(0, 1);<br>  }</pre><blockquote>So trackby works better when the array has no index change.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsAm4W1Ff3mU&amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FsAm4W1Ff3mU&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbd5e569f1efa862b7d8a27e847f31d7/href">https://medium.com/media/bbd5e569f1efa862b7d8a27e847f31d7/href</a></iframe><blockquote><strong><em>Please click on </em></strong>👏<strong><em> or </em></strong>Follow me on <a href="https://medium.com/@pradeepsrawat029">Medium</a> to read more about Angular, Pradeep and JS!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c311f375cb6a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/time-machine/trackby-with-ngfor-directive-in-angular-application-improving-your-website-performance-c311f375cb6a">TrackBy With ngFor Directive In Angular Application— Improving your website performance</a> was originally published in <a href="https://medium.com/time-machine">Time Machine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Get Video Thumbnails with Javascript. Video and image thumbnail for HTML file upload.]]></title>
            <link>https://medium.com/time-machine/how-to-get-video-thumbnails-with-javascript-video-and-image-thumbnail-for-html-file-upload-cc304ff7f7fb?source=rss-3ce58953fff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc304ff7f7fb</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[thumbnail]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Pradeep Singh Rawat]]></dc:creator>
            <pubDate>Sun, 29 Dec 2019 15:35:06 GMT</pubDate>
            <atom:updated>2020-06-14T17:22:00.487Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qSr8924CZkozdX45CCpZZA.jpeg" /><figcaption>Making video Thumbnail</figcaption></figure><h3><strong>Create thumbnail from video file via file using canvas and Javascript</strong></h3><p>After uploading the video. then make blob URL and set HTML video player.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*hnL9LPlYoWiSeacOcuEJyg.png" /></figure><blockquote>after click on capturevideoScreen()</blockquote><p>let getvideoDom=document.getElementsByTagName(‘video’);</p><blockquote>call capture(getvideoDom) function</blockquote><p><strong><em>This function retun current capture video {</em></strong></p><p><strong><em>canvas:Element,</em></strong></p><p><strong><em>base64:string</em></strong></p><p><strong><em>file:any</em></strong></p><p><strong><em>}</em></strong></p><pre>scaleFactor:number=0.25;</pre><pre>/*************************************************************<br>        Modify capture image width and height</pre><pre>*************************************************************/</pre><pre>capture(video) {<br>    let w = video.videoWidth * this.scaleFactor;<br>    let h = video.videoHeight * this.scaleFactor;<br>    let canvas = document.createElement(&#39;canvas&#39;);<br>    canvas.width = w;<br>    canvas.height = h;<br>    let ctx = canvas.getContext(&#39;2d&#39;);<br>    ctx.drawImage(video, 0, 0, w, h);<br>    let dataURI = canvas.toDataURL(&#39;image/jpeg&#39;);<br>    // let a = <br>    let boj={<br>      canvas:canvas,<br>      file:this.dataURLtoFile(dataURI, `${+new Date()}.jpg`),<br>      base64:dataURI<br>    }<br>    return boj;<br>  }</pre><pre>dataURLtoFile(dataurl, filename) {<br>    var arr = dataurl.split(&#39;,&#39;), mime = arr[0].match(/:(.*?);/)[1],<br>      bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);<br>    while (n--) {<br>      u8arr[n] = bstr.charCodeAt(n);<br>    }<br>    return new File([u8arr], filename, { type: mime });<br>  }</pre><blockquote>NOTE: if you are using Angular and React then get direct github code.</blockquote><p><a href="https://github.com/pradeepsrawat029/video-Thumbnail">pradeepsrawat029/video-Thumbnail</a></p><blockquote><em>Follow me on </em><a href="https://medium.com/@pradeepsrawat029"><em>Medium</em></a><em> , </em><a href="https://www.linkedin.com/in/pradeep-s-rawat/"><em>Linkdin</em></a><em> or </em><a href="https://www.quora.com/profile/Pr%C3%A5d%C3%A9%C3%A8p-S%C3%ADngh-R%C3%A5w%C3%A5t"><em>Q</em>uora</a><em> to read more about Angular, Pradeep and JS!</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc304ff7f7fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/time-machine/how-to-get-video-thumbnails-with-javascript-video-and-image-thumbnail-for-html-file-upload-cc304ff7f7fb">How to Get Video Thumbnails with Javascript. Video and image thumbnail for HTML file upload.</a> was originally published in <a href="https://medium.com/time-machine">Time Machine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Voice Recording. RecordingRTC Voice Recording .]]></title>
            <link>https://medium.com/time-machine/angular-voice-recording-recordingrtc-voice-recording-b466e81bc665?source=rss-3ce58953fff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b466e81bc665</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[voice-recorder]]></category>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[angular-4]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Pradeep Singh Rawat]]></dc:creator>
            <pubDate>Sun, 29 Dec 2019 14:42:41 GMT</pubDate>
            <atom:updated>2019-12-29T14:48:15.680Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="https://github.com/pradeepsrawat029/RecordRTC" src="https://cdn-images-1.medium.com/max/1024/1*FE4vEpTMVvHEVA2ynNMXCQ.png" /><figcaption>RTC recoding</figcaption></figure><h3>RecordingRTC Voice Recording . <strong>Voice Recorder</strong> is a convenient and simple online tool that can be used right in your browser.</h3><p>RecordRTC is a server-less (entire client-side) JavaScript library can be used to <strong>record</strong> WebRTC <strong>audio</strong>/video media streams.</p><blockquote><strong><em>Now start code</em></strong></blockquote><pre>/**<br>   * @function toggleRecord<br>   * check recording base on `recordingTimer`<br>   * getting permission on `mediaDevices` audio<br>   */<br>  toggleRecord() {<br>    if (this.recordingTimer) {<br>      this.stopRTC();<br>    } else {<br>      navigator.mediaDevices.getUserMedia({ audio: true }).then(stream =&gt; {<br>        this.startRTC(stream);<br>      }).catch(error =&gt; {<br>        alert(error)<br>      })<br>    }</pre><pre>/**<br>   * @param stream <br>   * @name recordWebRTC set recording `stream` and `options`<br>   * @var blobUrl set null UI update<br>   * @see startCountdown()<br>   */<br>  startRTC(stream: any) {<br>    this.recordWebRTC = new RecordRTC.StereoAudioRecorder(stream, this.options);<br>    this.mediaRecordStream = stream;<br>    this.blobUrl = null;<br>    this.recordWebRTC.record();<br>    this.startCountdown();<br>  }</pre><pre>/**<br>   * @function stopRTC<br>   * after `stop` recordWebRTC function getting blob<br>   * blob file making to blob url `blobUrl`<br>   * @name startCountdown stop counting with stream<br>   */<br>  stopRTC() {<br>    this.recordWebRTC.stop((blob) =&gt; {<br>      //NOTE: upload on server<br>      this.blobUrl = this.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(blob));<br>      this.startCountdown(true);<br>    })<br>  }</pre><pre>/**<br>   * @param clearTime default value `false` <br>   * `false` miens recording start if getting `true` then we are stop counting `clearStream`<br>   * Maximum Recoding time `10`Minutes @see minutes == 10<br>   */<br>  startCountdown(clearTime = false) {<br>    if (clearTime) {<br>      this.clearStream(this.mediaRecordStream);<br>      this.recordWebRTC = null;<br>      this.recordingTimer = null;<br>      this.mediaRecordStream = null;<br>      clearInterval(this.interval);<br>      return<br>    } else {<br>      this.recordingTimer = `00:00`;<br>      clearInterval(this.interval);<br>    }<br><br>    this.interval = setInterval(() =&gt; {<br>      let timer: any = this.recordingTimer;<br>      timer = timer.split(&#39;:&#39;);<br>      let minutes = +timer[0];<br>      let seconds = +timer[1];<br><br>      if (minutes == 10) {<br>        this.recordWebRTC.stopRecording();<br>        clearInterval(this.interval);<br>        return<br>      }<br>      ++seconds;<br>      if (seconds &gt;= 59) {<br>        ++minutes;<br>        seconds = 0;<br>      }<br><br>      if (seconds &lt; 10) {<br>        this.recordingTimer = `0${minutes}:0${seconds}`;<br>      } else {<br>        this.recordingTimer = `0${minutes}:${seconds}`;<br>      }<br>    }, 1000);<br>  }<br><br>  /**<br>   * @param stream clear stream Audio also video<br>   */<br>  clearStream(stream: any) {<br>    try {<br>      stream.getAudioTracks().forEach(track =&gt; track.stop());<br>      stream.getVideoTracks().forEach(track =&gt; track.stop());<br>    } catch (error) {<br>      //stream error<br>    }<br>  }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*S2d5km4h7R20IBoxc2zl1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*WQKyj4glNI8M7COO8Y7UIA.gif" /></figure><p><a href="https://github.com/pradeepsrawat029/RecordRTC">pradeepsrawat029/RecordRTC</a></p><h3>Code on github..</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b466e81bc665" width="1" height="1" alt=""><hr><p><a href="https://medium.com/time-machine/angular-voice-recording-recordingrtc-voice-recording-b466e81bc665">Angular Voice Recording. RecordingRTC Voice Recording .</a> was originally published in <a href="https://medium.com/time-machine">Time Machine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Canactivate v/s canload in angular]]></title>
            <link>https://medium.com/time-machine/canactivate-v-s-canload-in-angular-6cabb3e904a0?source=rss-3ce58953fff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cabb3e904a0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[canactivate]]></category>
            <category><![CDATA[ionic]]></category>
            <category><![CDATA[canload]]></category>
            <dc:creator><![CDATA[Pradeep Singh Rawat]]></dc:creator>
            <pubDate>Wed, 06 Nov 2019 17:29:53 GMT</pubDate>
            <atom:updated>2020-06-14T17:22:35.646Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5tec8URXEFjZWLNbD5J2w.png" /><figcaption>Routing</figcaption></figure><p>The auth guard has a major contribution to angular lazy loading modules. By the way, angular has many types of guard like <strong><em>(CanActivate, CanActivateChild, canDeactivate, CanLoad)</em></strong>. But we will talk about canActivate and canLoad guard.</p><blockquote>If a route has to be opened at the base of a condition, then it is possible for the guard.</blockquote><p><strong>Short and full information</strong> →</p><blockquote><strong>CanActivate</strong>: This protects the route, but does not prevent that module from loading.</blockquote><pre>canActivate(): Promise&lt;boolean | UrlTree&gt; {<br>    if (localStorage.getItem(&quot;token&quot;)) {<br>      const tree:UrlTree=this.router.parseUrl(&#39;/&#39;);<br>      return tree;<br>    } else {<br>      return true;<br>    }<br>  }</pre><blockquote><strong>CanLoad</strong>: This protects the route completely. Such as lazy loading the module and also protects all the routes associated with that module. If the user is unauthorized then it canLoad guard avoids additional loading of auth Modules</blockquote><pre>canLoad(): Promise&lt;boolean | UrlTree&gt; {<br>    if (localStorage.getItem(&quot;token&quot;)) {<br>      return true;<br>    } else {<br>      const tree:UrlTree=this.router.parseUrl(&#39;/login&#39;);<br>      return tree;<br>    }<br>  }</pre><blockquote>Canactivate and canload with example</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N82gXdWUSLJXOzzVmT6osA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNj51vgAwm6f88VRw80dyw.png" /><figcaption>Angular canCanactivate v/s canload</figcaption></figure><p>Route guards are most often implemented as classes that implement the needed route guard interface. Let’s see an example with a CanActivate route guard where we ask an auth service if the user is authenticated:</p><p>The CanLoad interface doesn’t have as much access to the current router state or activated route.</p><blockquote>Note: CanLoad and canActivate are instead meant as a way to improve the UX for your apps. if we are making a bug app then we are implemented on the server security should be.</blockquote><blockquote><strong>Please click on </strong><em>👏</em><strong> or </strong><em>Follow me on </em><a href="https://medium.com/@pradeepsrawat029"><em>Medium</em></a><em> or </em><a href="https://www.linkedin.com/in/pradeep-s-rawat/">Linkedin</a> <em>to read more about Angular and Javascript, Pradeep and JS!</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cabb3e904a0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/time-machine/canactivate-v-s-canload-in-angular-6cabb3e904a0">Canactivate v/s canload in angular</a> was originally published in <a href="https://medium.com/time-machine">Time Machine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular language Service static data using  pipes]]></title>
            <link>https://medium.com/time-machine/angular-language-service-static-data-using-pipes-dba4d5b5d3f?source=rss-3ce58953fff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/dba4d5b5d3f</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[angular-6]]></category>
            <dc:creator><![CDATA[Pradeep Singh Rawat]]></dc:creator>
            <pubDate>Mon, 09 Sep 2019 17:02:55 GMT</pubDate>
            <atom:updated>2019-09-09T17:03:40.751Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular language Service static data using pipes</h3><figure><img alt="ng g p translate" src="https://cdn-images-1.medium.com/max/614/1*_EsuX5tTZdZn-tPZjCcemQ.png" /></figure><p>import { Pipe, PipeTransform } from ‘@angular/core’;</p><p>import { TranslateService } from ‘../../services/translate/translate.service’;</p><p>@Pipe({</p><p>name: ‘translate’,</p><p>pure: false</p><p>})</p><p>export class TranslatePipe implements PipeTransform {</p><p>constructor(private translate: TranslateService) { }</p><p>transform(key: any): any {</p><p>return this.translate.data[key] || key;</p><p>}</p><p>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*G62YwQgAXobFYyk7kz_36Q.png" /></figure><p>Also generate translate service and put this code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*HFrxMzpf4XNxFyjgWLwT2Q.png" /></figure><p>Now finish your step .</p><p>appcomponent.html use</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*YSIofhR3TEhQ0MRS7tgoaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*ljTFIMmjzU5_IxkLssllAA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dba4d5b5d3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/time-machine/angular-language-service-static-data-using-pipes-dba4d5b5d3f">Angular language Service static data using  pipes</a> was originally published in <a href="https://medium.com/time-machine">Time Machine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>