<?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: Udith Indrakantha</title>
    <description>The latest articles on DEV Community by Udith Indrakantha (@udithgayan).</description>
    <link>https://dev.to/udithgayan</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%2F228341%2Fd6ab2ca7-9890-4df1-b050-463819c722cb.jpeg</url>
      <title>DEV Community: Udith Indrakantha</title>
      <link>https://dev.to/udithgayan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/udithgayan"/>
    <language>en</language>
    <item>
      <title>How to Intercept the HTTP Requests in Angular(Part 1)</title>
      <dc:creator>Udith Indrakantha</dc:creator>
      <pubDate>Tue, 04 Feb 2020 04:14:33 +0000</pubDate>
      <link>https://dev.to/udithgayan/how-to-intercept-the-http-requests-in-angular-part-1-1am6</link>
      <guid>https://dev.to/udithgayan/how-to-intercept-the-http-requests-in-angular-part-1-1am6</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/javascript-in-plain-english/how-to-intercept-the-http-requests-in-angular-2a67df423020" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zwn1H_5Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/96/96/2%2AqyDd_Q3LgG1B4RRozlOfCw.jpeg" alt="Udith Gayan Indrakantha"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/javascript-in-plain-english/how-to-intercept-the-http-requests-in-angular-2a67df423020" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;How to Intercept the HTTP Requests in Angular (Part 1) | by Udith Gayan Indrakantha | JavaScript In Plain English | Medium&lt;/h2&gt;
      &lt;h3&gt;Udith Gayan Indrakantha ・ &lt;time&gt;Feb 2, 2020&lt;/time&gt; ・ 2 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>angular</category>
      <category>javascript</category>
      <category>developers</category>
      <category>interceptor</category>
    </item>
    <item>
      <title>Send Emails without a server-side code with Angular</title>
      <dc:creator>Udith Indrakantha</dc:creator>
      <pubDate>Tue, 24 Dec 2019 16:21:22 +0000</pubDate>
      <link>https://dev.to/udithgayan/send-emails-without-a-server-side-code-with-angular-122k</link>
      <guid>https://dev.to/udithgayan/send-emails-without-a-server-side-code-with-angular-122k</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/@udith.indrakantha/send-emails-without-a-server-side-code-with-angular-e227c3e62dbd" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zwn1H_5Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/96/96/2%2AqyDd_Q3LgG1B4RRozlOfCw.jpeg" alt="Udith Gayan Indrakantha"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/@udith.indrakantha/send-emails-without-a-server-side-code-with-angular-e227c3e62dbd" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Send Emails without a server-side code with Angular | by Udith Gayan Indrakantha | JavaScript In Plain English | Medium&lt;/h2&gt;
      &lt;h3&gt;Udith Gayan Indrakantha ・ &lt;time&gt;Apr 8, 2020&lt;/time&gt; ・ 2 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>angular</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
    <item>
      <title>MVC Architecture as a Software Architecture</title>
      <dc:creator>Udith Indrakantha</dc:creator>
      <pubDate>Tue, 24 Dec 2019 14:03:45 +0000</pubDate>
      <link>https://dev.to/udithgayan/mvc-architecture-as-a-software-architecture-1jap</link>
      <guid>https://dev.to/udithgayan/mvc-architecture-as-a-software-architecture-1jap</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/@udith.indrakantha/mvc-architecture-as-a-software-architecture-e86073ac2411" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zwn1H_5Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/96/96/2%2AqyDd_Q3LgG1B4RRozlOfCw.jpeg" alt="Udith Gayan Indrakantha"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/@udith.indrakantha/mvc-architecture-as-a-software-architecture-e86073ac2411" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;MVC Architecture as a Software Architecture | by Udith Gayan Indrakantha | Medium&lt;/h2&gt;
      &lt;h3&gt;Udith Gayan Indrakantha ・ &lt;time&gt;Dec 18, 2019&lt;/time&gt; ・ 3 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>mvc</category>
      <category>webdev</category>
      <category>softwareengineering</category>
      <category>technology</category>
    </item>
    <item>
      <title>Simply Deploy your Angular App on Netlify</title>
      <dc:creator>Udith Indrakantha</dc:creator>
      <pubDate>Thu, 07 Nov 2019 18:00:48 +0000</pubDate>
      <link>https://dev.to/udithgayan/simply-deploy-your-angular-app-on-netlify-1am8</link>
      <guid>https://dev.to/udithgayan/simply-deploy-your-angular-app-on-netlify-1am8</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/@udith.indrakantha/simply-deploy-your-angular-app-on-netlify-edfba30301ea" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zwn1H_5Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/96/96/2%2AqyDd_Q3LgG1B4RRozlOfCw.jpeg" alt="Udith Gayan Indrakantha"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/@udith.indrakantha/simply-deploy-your-angular-app-on-netlify-edfba30301ea" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Simply Deploy your Angular App on Netlify - Udith Gayan Indrakantha - Medium&lt;/h2&gt;
      &lt;h3&gt;Udith Gayan Indrakantha ・ &lt;time&gt;Nov 3, 2019&lt;/time&gt; ・ 4 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aYMKNcyE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-fbdac08496f06c5bd53be920c7bc8d56d355b69c0fb7e49cac6357a70140af17.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>All about .replaceAll() in Java</title>
      <dc:creator>Udith Indrakantha</dc:creator>
      <pubDate>Wed, 23 Oct 2019 15:30:06 +0000</pubDate>
      <link>https://dev.to/udithgayan/all-about-replaceall-in-java-2o61</link>
      <guid>https://dev.to/udithgayan/all-about-replaceall-in-java-2o61</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/@udith.indrakantha/all-about-replaceall-in-java-314696b49676" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zwn1H_5Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/96/96/2%2AqyDd_Q3LgG1B4RRozlOfCw.jpeg" alt="Udith Gayan Indrakantha"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/@udith.indrakantha/all-about-replaceall-in-java-314696b49676" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;All about .replaceAll() in Java. java.lang.String class brings you a… | by Udith Gayan Indrakantha | Medium&lt;/h2&gt;
      &lt;h3&gt;Udith Gayan Indrakantha ・ &lt;time&gt;Oct 21, 2019&lt;/time&gt; ・ 2 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>java</category>
      <category>string</category>
      <category>manipulation</category>
      <category>replaceall</category>
    </item>
    <item>
      <title>Fixing 401 Error with CORS Preflights (with Spring boot)</title>
      <dc:creator>Udith Indrakantha</dc:creator>
      <pubDate>Sat, 28 Sep 2019 12:27:12 +0000</pubDate>
      <link>https://dev.to/udithgayan/fixing-401-error-with-cors-preflights-with-spring-boot-590j</link>
      <guid>https://dev.to/udithgayan/fixing-401-error-with-cors-preflights-with-spring-boot-590j</guid>
      <description>&lt;p&gt;When the web application runs on a different domain and the server runs on another domain, we have to deal with cross origin requests. But, if we don’t know the mechanism of cross origin resource sharing (CORS), we will end up with errors like 401.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error in brief&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My Angular web application runs on port 4200, and my spring boot application runs on server on port 8080. I could not enable CORS in my backend, so, I got an error when sending a request from my application like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QSela-xN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/gd0daqgu7gp2l4r7dokq.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QSela-xN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/gd0daqgu7gp2l4r7dokq.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reason&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My &lt;a href="https://webtechmora.blogspot.com/2019/09/pre-flight-request.html"&gt;pre-flight request&lt;/a&gt; is not responded with status OK(200).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I enabled CORS in my backend. To do this, there are several methods. Here in my post, I have shown the easiest way to do that. But, if you are interest in knowing other ways, &lt;a href="https://www.baeldung.com/spring-cors"&gt;click me&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By using Web Security in Spring Boot,&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You have to create a web security configuration class. I hope everybody creates that class for backend authentication purposes.&lt;/p&gt;

&lt;p&gt;If you have already created that class, inside &lt;em&gt;configure( HttpSecurity httpSecurity )&lt;/em&gt; method ,add this line &lt;em&gt;httpSecurity.cors();&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N1h-9a2G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/42oq0cclcz5wsjou6xhp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N1h-9a2G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/42oq0cclcz5wsjou6xhp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s that simple !!!&lt;br&gt;
Originally published at &lt;a href="https://webtechmora.blogspot.com"&gt;https://webtechmora.blogspot.com&lt;/a&gt; by Udith.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to use ng-bootstrapped Popup Modals within Angular Components</title>
      <dc:creator>Udith Indrakantha</dc:creator>
      <pubDate>Sat, 21 Sep 2019 03:49:58 +0000</pubDate>
      <link>https://dev.to/udithgayan/how-to-use-ng-bootstrapped-popup-modals-within-angular-components-39pf</link>
      <guid>https://dev.to/udithgayan/how-to-use-ng-bootstrapped-popup-modals-within-angular-components-39pf</guid>
      <description>&lt;p&gt;Hello guys, this article is about how to add ng-bootstrapped modals within your components in Angular application. Going through this article, a very beginner can learn how to add and use different bootstrapped gadgets and other stuffs  with your Angular application.&lt;/p&gt;

&lt;p&gt;I have already created a very simple project but not yet bootstrapped. I just need to add a popup message box when clicking on the button on the page. &lt;br&gt;
Below is how my application looks right now and I have used only app.component.ts and app.component.html files for this.&lt;/p&gt;

&lt;p&gt;Initial Web Page&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fp1f4wwz37lzs5o70f17q.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fp1f4wwz37lzs5o70f17q.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;app.component.html&lt;br&gt;
 &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftf6be9gwomb8o6e1w8nh.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftf6be9gwomb8o6e1w8nh.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;app.component.ts&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ful9skddwxq2kscgp53i8.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ful9skddwxq2kscgp53i8.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's begin to add the requirements to continue.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Step 1&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;


&lt;li&gt;Go to the root project folder of your project.&lt;/li&gt;


&lt;li&gt;Install ng-bootstrap to your project by running 
                                    &lt;code&gt;npm install --save @ng-bootstrap/ng-bootstrap&lt;/code&gt;
&lt;/li&gt;


&lt;li&gt;Go to app.module.ts file and import the Ngbmodule inside import array. 
                       &lt;code&gt; import {NgbModule} from '@ng-bootstrap/ng-bootstrap';&lt;/code&gt;  &lt;/li&gt;         

&lt;p&gt;app.module.ts&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg9e0sjbpidyzrt34yxlb.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg9e0sjbpidyzrt34yxlb.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;li&gt;Go to &lt;em&gt;index.html&lt;/em&gt; and copy the &lt;a href="https://getbootstrap.com/docs/4.3/getting-started/introduction/" rel="noopener noreferrer"&gt;bootstrap CDN &lt;/a&gt;code snippent from bootstrap site , within the scope of  tags.&lt;/li&gt;
&lt;br&gt;
                            ( For now,     )

&lt;p&gt;&lt;b&gt;&lt;u&gt;Step 2&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;


&lt;ul&gt;

&lt;li&gt;Go to ng-bootstrap site and find the bootstrap code section for Modal.(&lt;a href="https://ng-bootstrap.github.io/#/components/modal/examples" rel="noopener noreferrer"&gt;Modal-ng-bootstrap&lt;/a&gt;) &lt;/li&gt;

&lt;p&gt;Section for Modals&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqi26n717oyv1e4qhybkl.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqi26n717oyv1e4qhybkl.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
  &lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;/p&gt;


&lt;li&gt;Within the section I have circled in , when you click the button with name "&amp;lt;/&amp;gt;Code", you can find a code file with the name modal-component.ts with the following code snippet.&lt;/li&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnbwr7uci1hmuse4xcksp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnbwr7uci1hmuse4xcksp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;li&gt;Here , in the above code, you can find two classes as NgbdModalContent (squared in red colour) and NgbdModalComponent (squared in purple colour).&lt;/li&gt; 




&lt;li&gt;Now it's time to copy code from this snippet and paste it into your app.component.ts file. &lt;/li&gt;




&lt;li&gt;First, import the modules shown in Section 1 in the above image into your app.component.ts file.&lt;/li&gt;




&lt;li&gt;Secondly, Copy the whole code in section two and paste it at the very end of   the app.component.ts file.&lt;/li&gt;




&lt;li&gt;Thirdly, inject the service into the constructor of your AppComponent class in app.component.ts file ,as shown in section 3 .&lt;/li&gt;




&lt;li&gt;And, Lastly, Copy the method "copy()" shown in the section 4 as a netive method of  the AppComponent class.&lt;/li&gt;




&lt;li&gt;This method can be used in an (click) event within the button in html file now.&lt;/li&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Step 3&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;




&lt;li&gt;Enter NgbdModalContent class  in declarations array as well as an entryComponent in app.module.ts file.  &lt;/li&gt;     

&lt;p&gt;app.module.ts&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc7cw9ms1sexvf1j1f4oq.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc7cw9ms1sexvf1j1f4oq.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;b&gt;&lt;u&gt;Finally&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;This is my app.component.ts file and html file .&lt;/p&gt;

&lt;p&gt;app.component.ts&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fu7udaqzejmatw6jcz93b.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fu7udaqzejmatw6jcz93b.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;app.component.html&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftdtaqpic7p0wjzrryvxb.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftdtaqpic7p0wjzrryvxb.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Final View when clicked on the button on the page,&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqyln2uad6bbq13pnyf6t.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqyln2uad6bbq13pnyf6t.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Enjoy bootstrap!!!&lt;/p&gt;


&lt;/ul&gt;

</description>
      <category>angular</category>
      <category>ngbootstrap</category>
      <category>bootstrap</category>
      <category>modals</category>
    </item>
  </channel>
</rss>
