<?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[Dialog Component Angular (5) - Medium]]></title>
        <description><![CDATA[Build your own Dialog Component on Angular 5 - Medium]]></description>
        <link>https://medium.com/dialog-component-angular-5?source=rss----479cedac7ee9---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Dialog Component Angular (5) - Medium</title>
            <link>https://medium.com/dialog-component-angular-5?source=rss----479cedac7ee9---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 19:48:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/dialog-component-angular-5" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[[Dialog Component — Angular (5)] Message Component]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-message-component-4e622a730a25?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/4e622a730a25</guid>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angular-5]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:45:29 GMT</pubDate>
            <atom:updated>2018-01-21T15:45:29.302Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dialog Component — Angular (5) | Message Component</h3><p>On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-model-fc2677e59a78">previous article</a> we have created the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-model-fc2677e59a78">Message Model and Enum</a>. So let&#39;s make the Message UI.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3ed7fe435978a57f30fd873f41e5589/href">https://medium.com/media/d3ed7fe435978a57f30fd873f41e5589/href</a></iframe><p>And let&#39;s give some style to our HTML</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a174eecc97b0563ec92c1adb80097b7d/href">https://medium.com/media/a174eecc97b0563ec92c1adb80097b7d/href</a></iframe><p>And then, create the Message Component logical:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e0dbc3f79f98b8cee7dd24690163d76/href">https://medium.com/media/1e0dbc3f79f98b8cee7dd24690163d76/href</a></iframe><p>That&#39;s was ease hey?! So let&#39;s create the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-service-5a6fe34633f1">Service</a> on the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-service-5a6fe34633f1">following article</a>.</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-model-fc2677e59a78">Previous</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-service-5a6fe34633f1">Next</a> &gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e622a730a25" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-message-component-4e622a730a25">[Dialog Component — Angular (5)] Message Component</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dialog Component — Angular (5) | Message Service]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-message-service-5a6fe34633f1?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/5a6fe34633f1</guid>
            <category><![CDATA[components]]></category>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[angula]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular-5]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:45:05 GMT</pubDate>
            <atom:updated>2018-01-21T15:45:05.358Z</atom:updated>
            <content:encoded><![CDATA[<p>On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-component-4e622a730a25">previous article</a> we have created the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-component-4e622a730a25">Message Component</a>. So now we are going to give it some live :)</p><p>The Message Service is the one that you will be using across your project. So whenever you need to invoke the message, you are going to inject it on the component`s constructor and call the proper method (for now we are doing only the alert)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b23efcf6cf2dec7d5a09b57c90830aac/href">https://medium.com/media/b23efcf6cf2dec7d5a09b57c90830aac/href</a></iframe><p>Yep! We are nearly done, so let&#39;s import it to the Core Module to make it available to the project on the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-consuming-the-message-service-77050e0bc0bd">next article</a>.</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-component-4e622a730a25">Previous</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-consuming-the-message-service-77050e0bc0bd">Next</a> &gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a6fe34633f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-message-service-5a6fe34633f1">Dialog Component — Angular (5) | Message Service</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dialog Component — Angular (5) | Message Model]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-message-model-fc2677e59a78?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/fc2677e59a78</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[componen]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[angular-5]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:43:11 GMT</pubDate>
            <atom:updated>2018-01-21T15:43:10.966Z</atom:updated>
            <content:encoded><![CDATA[<p>So up to now, we have the Dialog Component ready to be consumed. As per our <a href="https://medium.com/@tbernardes/dialog-component-angular-5-consuming-the-dialog-component-ffcdc69c3652">previous articles</a>, you might noticed that I like to organise the code to make it as cleared as possible, so for the Message Service we are going to do the same. Let&#39;s start to create the Models, which will support the message component and the service.</p><p>The MessageTypeEnum is an enumerator that will define the type of the message:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e05c7b6fb44cba315f88a277fb791aba/href">https://medium.com/media/e05c7b6fb44cba315f88a277fb791aba/href</a></iframe><p>The MessageModel is the one responsible for the Dialog Content. On this example we will only send to the component the property message, but you can extend it to send Title, Buttons and so on…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c5748f6be79f581d581feb5d2ff4b70/href">https://medium.com/media/9c5748f6be79f581d581feb5d2ff4b70/href</a></iframe><p>So let&#39;s move to the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-component-4e622a730a25">Message Component</a> on the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-component-4e622a730a25">next article</a>.</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-consuming-the-dialog-component-ffcdc69c3652">Previous</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-component-4e622a730a25">Next</a> &gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc2677e59a78" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-message-model-fc2677e59a78">Dialog Component — Angular (5) | Message Model</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dialog Component — Angular (5) | Consuming the Dialog Component]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-consuming-the-dialog-component-ffcdc69c3652?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/ffcdc69c3652</guid>
            <category><![CDATA[angular-5]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:42:33 GMT</pubDate>
            <atom:updated>2018-01-21T15:42:32.202Z</atom:updated>
            <content:encoded><![CDATA[<p>On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-core-module-24decf1177a8">previous article</a>, we have created the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-core-module-24decf1177a8">Core Module</a> as a Singleton, to make it available across the whole project. So the App Module is the one that will make it happen!</p><p>In the app.module.ts (generated by the ng-cli) we have the following import</p><blockquote>…<br>imports: [<br> BrowserModule<br>],<br>…</blockquote><p>then, we will need to import the core.module and add it into the imports</p><blockquote>…<br><strong>import { CoreModule } from ‘./core.module’</strong><br>…<br>imports: [<br> BrowserModule,<br><strong> CoreModule.forRoot()<br></strong>],<br>…</blockquote><p>This step will make our CorModule a Singleton, so when the project is started, it will be loaded once and enable all the solution to use this instance, even the lazy modules.</p><p>Ok ok, maybe you are anxious to see it on action. Well, I am lol, so let go to the finals steps.</p><p>Recap, we have built our Dialog Component. As you could notice along the tutorial, the Dialog Component ia a generic component that will handle the behaviour for the user actions, and mainly, be able to the developer extend and have multiple king of Dialogs in one project. For example, you can have an Error Dialog, an Alert Dialog or also a Confirmation Dialog.</p><p>On the next article, we will be creating the Message Service! I will be covering on how to create the Alert Dialog, and as a homework you can extend it to an Error Dialog and also Confirmation Dialog (I&#39;ll be here if you need any help, but I encourage you to do it on your own to evolve your developer logical).</p><p>As the hardest code is done, the following will be quick and easy :) so let&#39;s do it on the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-model-fc2677e59a78">next article</a>!</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-core-module-24decf1177a8">Previous</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-message-model-fc2677e59a78">Next</a> &gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffcdc69c3652" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-consuming-the-dialog-component-ffcdc69c3652">Dialog Component — Angular (5) | Consuming the Dialog Component</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dialog Component — Angular (5) | Core Module]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-core-module-24decf1177a8?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/24decf1177a8</guid>
            <category><![CDATA[componen]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[angular-5]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:41:44 GMT</pubDate>
            <atom:updated>2018-01-21T15:42:00.113Z</atom:updated>
            <content:encoded><![CDATA[<p>On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-module-1adf5c074177">previous article</a> we have created the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-module-1adf5c074177">Dialog Module</a>, which is responsible to wrap the whole Dialog Component, Services and Models. So now, we are going to create the Core Module.</p><p>The Core Module has it&#39;s name as a Angular Convention for its responsibility. It will sit beside of the app.module.ts on your application and it will be inject into the app.module.ts.</p><p>The vantage of the Core Module is to make components available for the whole project! So be careful, only add modules in Core Module once, and also if it&#39;s going to be used across the whole project (e.g. our Dialog Component — all pages might need to use it). We will create the Core Module to be a Singleton, so let&#39;s code it!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d778604eae1b1ce5266a0386590559c/href">https://medium.com/media/5d778604eae1b1ce5266a0386590559c/href</a></iframe><p>As per the following structure, the Core Module will be sitting beside of the App Module.</p><p>.. src<br>.. .. app<br>.. .. .. components<br>.. .. .. .. backdrop<br>.. .. .. .. .. backdrop.component.scss<br>.. .. .. .. .. backdrop.component.ts<br>.. .. .. .. dialog<br>.. .. .. .. .. dialog.component.html<br>.. .. .. .. .. dialog.component.scss<br>.. .. .. .. .. dialog.component.ts<br>.. .. .. .. models<br>.. .. .. .. .. dialog-active.model.ts<br>.. .. .. .. .. dialog-content-ref.model.ts<br>.. .. .. .. .. dialog-options.model.ts<br>.. .. .. .. .. dialog-ref.model.ts<br>.. .. .. .. .. index.ts<br>.. .. .. .. services<br>.. .. .. .. .. dialog.service.ts<br>.. .. .. .. dialog.module.ts<br>.. .. .. app.component.html<br>.. .. .. app.component.scss<br>.. .. .. app.component.ts<br>.. .. .. app.module.ts<strong><br>.. .. .. core.module.ts</strong></p><p>On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-consuming-the-dialog-component-ffcdc69c3652">next article</a> we are going to make it available on the App Module! Let&#39;s go…</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-module-1adf5c074177">Previous</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-consuming-the-dialog-component-ffcdc69c3652">Next</a> &gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24decf1177a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-core-module-24decf1177a8">Dialog Component — Angular (5) | Core Module</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Dialog Component — Angular (5)] Module]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-module-1adf5c074177?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/1adf5c074177</guid>
            <category><![CDATA[angula]]></category>
            <category><![CDATA[componen]]></category>
            <category><![CDATA[angular-5]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[dialog]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:41:14 GMT</pubDate>
            <atom:updated>2018-01-21T15:41:14.210Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dialog Component — Angular (5) | Module</h3><p>Ok! On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-service-fc34ffd44f57">previous article</a> we have finished our Dialogo Component, however we need to put it all together to make it available to the project.</p><p>The Module is responsible to stitch up all together, so you will need only to import the module, and it&#39;s imports everything else. So let&#39;s build the Module.</p><p><strong>Dialog Module</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/962de4b928f3573e382cfc53faf53261/href">https://medium.com/media/962de4b928f3573e382cfc53faf53261/href</a></iframe><p>The project file&#39;s struct will look like this:</p><p>.. src<br>.. .. app<br>.. .. .. components<br>.. .. .. .. backdrop<br>.. .. .. .. .. backdrop.component.scss<br>.. .. .. .. .. backdrop.component.ts<br>.. .. .. .. dialog<br>.. .. .. .. .. dialog.component.html<br>.. .. .. .. .. dialog.component.scss<br>.. .. .. .. .. dialog.component.ts<br>.. .. .. .. models<br>.. .. .. .. .. dialog-active.model.ts<br>.. .. .. .. .. dialog-content-ref.model.ts<br>.. .. .. .. .. dialog-options.model.ts<br>.. .. .. .. .. dialog-ref.model.ts<br>.. .. .. .. .. index.ts<br>.. .. .. .. services<br>.. .. .. .. .. dialog.service.ts<br><strong>.. .. .. .. dialog.module.ts</strong><br>.. .. .. app.component.html<br>.. .. .. app.component.scss<br>.. .. .. app.component.ts<br>.. .. .. app.module.ts<strong><br></strong>.. .. .. core.module.ts</p><p>On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-core-module-24decf1177a8">next article</a>, we will import the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-core-module-24decf1177a8">Dialog Module</a> and make it available in the whole project.</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-service-fc34ffd44f57">Previous</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-core-module-24decf1177a8">Next</a> &gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1adf5c074177" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-module-1adf5c074177">[Dialog Component — Angular (5)] Module</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Dialog Component — Angular (5)] Service]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-service-fc34ffd44f57?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/fc34ffd44f57</guid>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[angular-5]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[components]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:40:36 GMT</pubDate>
            <atom:updated>2018-01-21T15:40:35.602Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dialog Component — Angular (5) | Service</h3><p>Well, up to now we have just prepare our Dialog to have some live. On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-backdrop-1ca123690ba4">previous article</a> we have created our backdrop for the Dialog, and now we will create the Service, that will orchestrate all the previous components and models we have created.</p><p>The Dialog Service is the heart of our Dialog Component. It will be responsible to orchestrate the whole dialog, and on your project, it will be the only service that you will be calling to invoke the Dialog, so let&#39;s do a heavy work on this one!</p><p>Up to now, we have the following file structure:</p><p>.. src<br>.. .. app<br>.. .. .. components<br>.. .. .. .. backdrop<br>.. .. .. .. .. backdrop.component.scss<br>.. .. .. .. .. backdrop.component.ts<br>.. .. .. .. dialog<br>.. .. .. .. .. dialog.component.html<br>.. .. .. .. .. dialog.component.scss<br>.. .. .. .. .. dialog.component.ts<br>.. .. .. .. models<br>.. .. .. .. .. dialog-active.model.ts<br>.. .. .. .. .. dialog-content-ref.model.ts<br>.. .. .. .. .. dialog-options.model.ts<br>.. .. .. .. .. dialog-ref.model.ts<br>.. .. .. .. .. index.ts<br><strong>.. .. .. .. services<br>.. .. .. .. .. dialog.service.ts</strong><br>.. .. .. app.component.html<br>.. .. .. app.component.scss<br>.. .. .. app.component.ts<br>.. .. .. app.module.ts</p><p><strong>Dialog Service</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89e845942cd2c9f08acac863467e9a18/href">https://medium.com/media/89e845942cd2c9f08acac863467e9a18/href</a></iframe><p>Yeah! That&#39;s was big one! I hope I could be as clearer as I wished to give you more detail about it. Maybe it has too much information, but do not hesitate to drop me a message or even ask the community for help.</p><p>And finally, we are goind to stich up all together on the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-module-1adf5c074177">next article</a>, creating the Dialog Module.</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-backdrop-1ca123690ba4">Previous</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-module-1adf5c074177">Next</a>&gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc34ffd44f57" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-service-fc34ffd44f57">[Dialog Component — Angular (5)] Service</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Dialog Component — Angular (5)] Backdrop]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-backdrop-1ca123690ba4?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/1ca123690ba4</guid>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angular-5]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:39:51 GMT</pubDate>
            <atom:updated>2018-01-21T15:39:51.344Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dialog Component — Angular (5) | Backdrop</h3><p>On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-component-3660ed8b1e02">previous article</a> we developed the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-component-3660ed8b1e02">Dialog Component</a>. So now, we are going to create the optional backdrop that will be on the back of the dialog.</p><p>Even being optional, the backdrop has 2 important role:</p><ul><li>Avoid the user to click or navigate on the website while the Dialog message is opened</li><li>Stand out the message to the user take an action</li></ul><p>Below you will find the files structure for the Backdrop Component:</p><p>.. src<br>.. .. app<br>.. .. .. components<br><strong>.. .. .. .. backdrop<br>.. .. .. .. .. backdrop.component.scss<br>.. .. .. .. .. backdrop.component.ts</strong><br>.. .. .. .. dialog<br>.. .. .. .. .. dialog.component.html<br>.. .. .. .. .. dialog.component.scss<br>.. .. .. .. .. dialog.component.ts<br>.. .. .. .. models<br>.. .. .. .. .. dialog-active.model.ts<br>.. .. .. .. .. dialog-content-ref.model.ts<br>.. .. .. .. .. dialog-options.model.ts<br>.. .. .. .. .. dialog-ref.model.ts<br>.. .. .. .. .. index.ts<br>.. .. .. app.component.html<br>.. .. .. app.component.scss<br>.. .. .. app.component.ts<br>.. .. .. app.module.ts</p><p>Let&#39;s do it!</p><p><strong>Backdrop Component (TS)</strong></p><p>Yes, it&#39;s just a blank component :)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52f590efd7ef26693301a515ed0845de/href">https://medium.com/media/52f590efd7ef26693301a515ed0845de/href</a></iframe><p><strong>Backdrop Component (SCSS)</strong></p><p>Here you will make the backdrop have some color. So you can customise it as you wish, so you can have a white backdrop, or any other color you wish. On this example we will have a black one.</p><p>Note: It&#39;s nice to give some transparency for the backdrop, on this example we are making the black on 0.7 opacity ;)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9f6a6bd8619c1b901838076953142a6/href">https://medium.com/media/a9f6a6bd8619c1b901838076953142a6/href</a></iframe><p>This one was easy hey?! So the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-service-fc34ffd44f57">next article</a> is the heart of our our component, the Service! Let&#39;s go…</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-component-3660ed8b1e02">Previos</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-service-fc34ffd44f57">Next</a>&gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ca123690ba4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-backdrop-1ca123690ba4">[Dialog Component — Angular (5)] Backdrop</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Dialog Component — Angular (5)] Component]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-component-3660ed8b1e02?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/3660ed8b1e02</guid>
            <category><![CDATA[angular-5]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[dialog]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:39:08 GMT</pubDate>
            <atom:updated>2018-01-21T15:39:08.345Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dialog Component — Angular (5) | Component</h3><p>So now that we&#39;ve created all the Modules that will support the application on the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-models-f2fa79f0d7c">previous article</a>, let&#39;s prepare the Dialog Component.</p><p>The component it&#39;s simple, as it will contain only the logic of the wrap. As you can see below on the dialog.component.html, it contain a ng-content tag, so when you will use the component&#39;s service, it will inject your customised content within this tag.</p><p>In resume, the Dialog Component will handle the behaviours and also the style of the wrapper. For the component, you will have the following structure on your project:</p><p>.. src<br>.. .. app<br>.. .. .. components<br><strong>.. .. .. .. dialog<br>.. .. .. .. .. dialog.component.html<br>.. .. .. .. .. dialog.component.scss<br>.. .. .. .. .. dialog.component.ts</strong><br>.. .. .. .. models<br>.. .. .. .. .. dialog-active.model.ts<br>.. .. .. .. .. dialog-content-ref.model.ts<br>.. .. .. .. .. dialog-options.model.ts<br>.. .. .. .. .. dialog-ref.model.ts<br>.. .. .. .. .. index.ts<br>.. .. .. app.component.html<br>.. .. .. app.component.scss<br>.. .. .. app.component.ts<br>.. .. .. app.module.ts</p><p>Let&#39;s have a look on the code below:</p><p><strong>Dialog Component (TS)</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0cdde198f89983005fa530ad131c623f/href">https://medium.com/media/0cdde198f89983005fa530ad131c623f/href</a></iframe><p><strong>Dialog Component (SCSS)</strong></p><p>The style is very simple. So the :host will expand the dialog on the screen and the .dialog class will centralise the dialog object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2eb7de575afbbc1d564ab212615a6311/href">https://medium.com/media/2eb7de575afbbc1d564ab212615a6311/href</a></iframe><p><strong>Dialog Component (HTML)</strong></p><p>And this is the component itself, it&#39;s just a wrapper where the customised component will be injected.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee3e4245327c2d6dfb78b751b352779d/href">https://medium.com/media/ee3e4245327c2d6dfb78b751b352779d/href</a></iframe><p>On this article we learned how to create the Dialog component, which is a wrapper that will allow you to inject different&#39;s dialogs within this structure.</p><p>On the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-backdrop-1ca123690ba4">next article</a>, we are going to create the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-backdrop-1ca123690ba4">Dialog Backdrop</a>, which is optional depending on your configuration when calling the Dialog.</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-models-f2fa79f0d7c">Previous</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-backdrop-1ca123690ba4">Next</a> &gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3660ed8b1e02" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-component-3660ed8b1e02">[Dialog Component — Angular (5)] Component</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dialog Component — Angular (5) | Models]]></title>
            <link>https://medium.com/dialog-component-angular-5/dialog-component-angular-5-models-f2fa79f0d7c?source=rss----479cedac7ee9---4</link>
            <guid isPermaLink="false">https://medium.com/p/f2fa79f0d7c</guid>
            <category><![CDATA[components]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angula]]></category>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[angular-5]]></category>
            <dc:creator><![CDATA[Thiago Bernardes]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 15:38:13 GMT</pubDate>
            <atom:updated>2018-01-21T15:38:12.571Z</atom:updated>
            <content:encoded><![CDATA[<p>The models we are going to create here is to keep the component organised and also give more support to the Dialog Component.</p><p>We are going to create the files <strong>IN BOLD</strong> below within the folder <strong>MODELS</strong>:</p><p>.. src<br>.. .. app<br>.. .. .. components<br><strong>.. .. .. .. models<br>.. .. .. .. .. dialog-active.model.ts<br>.. .. .. .. .. dialog-content-ref.model.ts<br>.. .. .. .. .. dialog-options.model.ts<br>.. .. .. .. .. dialog-ref.model.ts<br>.. .. .. .. .. index.ts</strong><br>.. .. .. app.component.html<br>.. .. .. app.component.scss<br>.. .. ..app.component.ts<br>.. .. ..app.module.ts</p><p><em>Below on each snippet, has the full path where the file needs to be created</em></p><p>Let&#39;s go into each of those files :)</p><p><strong>Dialog Options</strong> <br>The <em>DialogOptionsModel</em> allow us to extend properties that can make the Dialog very flexible, such as:<br>- backdrop: include the backdrop below the dialog<br>- closeOutsideClick: allow the user to click anywhere but the dialog, to close it.<br>- top: Position that the dialog will be from the top of the screen<br>- data: Which data we will send to Modal, so it can get customizable</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17d16e74739ac89a261ba6fdadc72429/href">https://medium.com/media/17d16e74739ac89a261ba6fdadc72429/href</a></iframe><p>Note that the class is a Generic class, where <strong>T</strong> will be the type of the <strong>data</strong> property that will be shared on the component body.</p><p><strong>Dialog Active</strong> <br>The <em>DialogActiveModel</em> is responsible for the events within the dialog. On this example, we have the following:<br>- close: When the user click on close, and the dialog can be customised with some data to send to the method<br>- dismiss: When the user click out side of the dialog, if it&#39;s allowed by the options above.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f540ba563ed3b8884a54d240e9f4718e/href">https://medium.com/media/f540ba563ed3b8884a54d240e9f4718e/href</a></iframe><p><strong>Dialog Content Ref</strong></p><p>The <em>DialogContentRefModel</em> is related to the modal component itself. It will be used to inject it into the HTML.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4306a99066e8477b1fe1ee9072018cf0/href">https://medium.com/media/4306a99066e8477b1fe1ee9072018cf0/href</a></iframe><p><strong>Dialog Ref</strong> <br>The DialogRefModel will be responsible to handle the behaviour within the Dialog Reference. The explanations are in the code as a comment:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/252d23cf284dd711d835321bf9b96dc0/href">https://medium.com/media/252d23cf284dd711d835321bf9b96dc0/href</a></iframe><p><strong>Models</strong> <br>On TypeScript, I like creating an Index file, so it will help to import the modules.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/135f11d73154a6a3b69e1bd22a81b1e4/href">https://medium.com/media/135f11d73154a6a3b69e1bd22a81b1e4/href</a></iframe><p>For example, rather then:<br>import { DialogActiveModel } from ‘../components/models/dialog-active.model.ts&#39;;<br>import { DialogOptionsModel } from ‘../components/models/dialog-options.model.ts&#39;;</p><p>I can do this:<br><br>import { DialogActiveModel, DialogOptionsModel } from ‘../components/models&#39;;</p><p>It&#39;s better, hey ?! :)</p><p>So those are the Models that will support our component. So let&#39;s now create the <a href="https://medium.com/@tbernardes/dialog-component-angular-5-component-3660ed8b1e02">DialogComponent</a>.</p><p>&lt;&lt; <a href="https://medium.com/@tbernardes/dialog-component-angular-5-get-ready-1e8d2c6e7e73">Previous</a>= <a href="https://medium.com/@tbernardes/dialog-component-angular-5-menu-dbb824e2cb7b">MENU</a> = <a href="https://medium.com/@tbernardes/dialog-component-angular-5-component-3660ed8b1e02">Next</a>&gt;&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2fa79f0d7c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dialog-component-angular-5/dialog-component-angular-5-models-f2fa79f0d7c">Dialog Component — Angular (5) | Models</a> was originally published in <a href="https://medium.com/dialog-component-angular-5">Dialog Component Angular (5)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>