<?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: Ahmed Abdelsalam</title>
    <description>The latest articles on DEV Community by Ahmed Abdelsalam (@geeksamu).</description>
    <link>https://dev.to/geeksamu</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%2F81098%2F74eed436-b1d7-4451-9a0c-d0fd5340d7e3.jpeg</url>
      <title>DEV Community: Ahmed Abdelsalam</title>
      <link>https://dev.to/geeksamu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/geeksamu"/>
    <language>en</language>
    <item>
      <title>Why I Transferred My Domains From Godaddy to Namesilo</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Fri, 22 Nov 2019 18:09:52 +0000</pubDate>
      <link>https://dev.to/geeksamu/why-i-transferred-my-domains-from-godaddy-to-namesilo-2b3c</link>
      <guid>https://dev.to/geeksamu/why-i-transferred-my-domains-from-godaddy-to-namesilo-2b3c</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Why I Transferred My Domains From GoDaddy to Namesilo&lt;/strong&gt;
&lt;/h3&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AKD0PWlRKFuUnpk92CnT9Uw.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AKD0PWlRKFuUnpk92CnT9Uw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;2 Gifts at the end of the Article.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I have been using Godaddy for more than 6 years, I bought more than 100 domains on it. Before I left I had 10+ domains on Godaddy. Here’s the receipt of the first domain I bought from Godaddy&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ai4BYH1Rgkb6VosFef8ttzQ.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ai4BYH1Rgkb6VosFef8ttzQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s 6 years and 2 months ago. That Domain cost me about $1 at that time with a coupon (about 8EGP in my country's currency at that time).&lt;/p&gt;

&lt;p&gt;At the time of this receipt, the regular price of a .com domain was $10 and the same for the renewal. I noticed that Godaddy is increasing the renewal price of domains every year but It didn't matter to me till I found that it was increasing by %20 over the 2018 price of$14.99.&lt;/p&gt;

&lt;p&gt;In February 2019 I renewed a .org domain for $21.17, I thought It was expensive because it's a 3 letter domain. But when I tried to renew my .com normal domains I found it will cost me $18.17.&lt;/p&gt;

&lt;p&gt;I made a google search and found out that only GoDaddy was increasing its prices.&lt;/p&gt;

&lt;p&gt;So I had to look for a better and cheaper provider after checking many reviews I found that &lt;a href="https://bit.ly/349Ra8U" rel="noopener noreferrer"&gt;NameSilo&lt;/a&gt; is the best one and cheaper than Godaddy and even other providers. Check the prices at NameSilo here: &lt;a href="https://bit.ly/35rF7Ea" rel="noopener noreferrer"&gt;NameSilo Pricing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are some comparisons between &lt;a href="https://bit.ly/349Ra8U" rel="noopener noreferrer"&gt;NameSilo&lt;/a&gt; and Godaddy:&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;What really matters to me from this comparison:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Price of registration.&lt;/li&gt;
&lt;li&gt;Price of renewal.&lt;/li&gt;
&lt;li&gt;WHOIS Privacy.&lt;/li&gt;
&lt;li&gt;30 Days period for renewing expired domains.&lt;/li&gt;
&lt;li&gt;Accepts Bitcoin&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will save me about 40% of the cost for each year as I pay for many domains renewal.&lt;/p&gt;

&lt;h3&gt;
  
  
  The First Gift
&lt;/h3&gt;

&lt;p&gt;The good part here and the gift for you guys is that you can transfer your domain at that low price and a $1 discount for each domain all you need is to use one of these coupons&lt;/p&gt;

&lt;p&gt;medium1usd&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;mediumcoupon&lt;/p&gt;

&lt;p&gt;So now If you are going to buy a.com domain from &lt;a href="https://bit.ly/349Ra8U" rel="noopener noreferrer"&gt;NameSilo&lt;/a&gt; you will save $7 per domain with the discount coupons medium1usd , mediumcoupon&lt;/p&gt;

&lt;h3&gt;
  
  
  The Second gift
&lt;/h3&gt;

&lt;p&gt;If you’re looking for free hosting for your websites here’s a &lt;a href="http://bit.ly/2B5ReJR" rel="noopener noreferrer"&gt;$50 in FREE Hosting Credit on DigitalOcean&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tech</category>
      <category>cloud</category>
      <category>technology</category>
      <category>hosting</category>
    </item>
    <item>
      <title>Digitalocean Promo Code — Yup, $50 in FREE Hosting Credit!</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Sat, 12 Oct 2019 11:18:51 +0000</pubDate>
      <link>https://dev.to/geeksamu/digitalocean-promo-code-yup-50-in-free-hosting-credit-4mn8</link>
      <guid>https://dev.to/geeksamu/digitalocean-promo-code-yup-50-in-free-hosting-credit-4mn8</guid>
      <description>&lt;h3&gt;
  
  
  Digitalocean Promo Code — Yup, $50 in FREE Hosting Credit!
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1BHQkks2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aqpj5AY9-rQx48uoeccXJJw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1BHQkks2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aqpj5AY9-rQx48uoeccXJJw.png" alt=""&gt;&lt;/a&gt;Digitalocean Promo Code — Yup, $50 in FREE Hosting Credit!&lt;/p&gt;

&lt;p&gt;Hey friends, if you’re building things on the web then DO is a great service for spinning up just about anything. I have sites running there and some scripts as well, $5 per month for a VPS you can’t beat it. Being that I’m such an awesome guy I’d like to offer you my Digitalocean promo code so you can get a free credit when opening up your account. Just use the link below to apply your promo code before signing up.&lt;/p&gt;

&lt;h3&gt;
  
  
  –&amp;gt;&amp;gt; &lt;a href="http://bit.ly/2B5ReJR"&gt;Get your $50 in FREE hosting credit HERE&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;From there you’ll be on your way to set up something slick on a reliable host. You’ll also have some free hosting credit to use for a while. If you’d like to learn more about Digitalocean, here is a review I put together for you.&lt;/p&gt;

&lt;p&gt;From there you’ll be on your way to setting up something slick on a reliable host. You’ll also have some free hosting credit to use for a while. If you’d like to learn more about Digitalocean, here is a review I put together for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  DigitalOcean, Future of the Cloud — A Review
&lt;/h3&gt;

&lt;p&gt;Cloud hosting battle lines have been marked and world markets are awarded to the winners. Behemoths in the cloud space have been adding services at an unparalleled pace. Tremendous opportunities are creating new companies daily, touting unique, if not identical services.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://bit.ly/2B5ReJR"&gt;DigitalOcean&lt;/a&gt; has carved out a defined niche in the cloud. As of 2018, the corporation was the third-ranked cloud provider in the world. Founded in 2011, DigitalOcean is miles away from the fierce tech battlegrounds of Silicon Valley and the Pacific Northwest. Simplicity with architecture and pricing, DigitalOcean provides reliable infrastructure to scale applications worldwide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What makes DigitalOcean Unique?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aimed at the developer community, DigitalOcean boasts 12 data centers located around the globe. The cloud-hosting company touts its fundamental theme as a” &lt;strong&gt;VPS image can be deployed within 60 seconds&lt;/strong&gt;.”&lt;/p&gt;

&lt;p&gt;Logging into the service is uncomplicated. Supply a few items of vital information, the name of your project and off you go.&lt;/p&gt;

&lt;p&gt;Digital Ocean’s dashboard is clean and uncluttered, your applications waiting. DigitalOcean bills by the month and only for the services employed. With other cloud-hosting providers, developers must proceed to higher tiers for root access, not with DigitalOcean. Users are billed by the deployment of 1) Ram 2) CPU 3) SSD Disk Space 4) Bandwidth. Keep in mind though, if you use a Digitalocean coupon you can save on your initial billing costs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tub3N-Ql--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/750/0%2AaBQWFWuh_7xWDB9Q" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tub3N-Ql--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/750/0%2AaBQWFWuh_7xWDB9Q" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a Droplet Anyway?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Droplets are virtual machines developers create with a blend of resources. Hit the “Create Droplet” button to encounter what is under the DigitalOcean hood. Users are overwhelmed by the number of choices. Scrolling down the page, developers realize why DigitalOcean is advancing at such a remarkable pace.&lt;/p&gt;

&lt;p&gt;Droplets in DigitalOcean ties the platform together. Unlike other disparate cloud-hosting providers, the DigitalOcean ecosystem is a rational evolution from one service to another. Example; create a droplet as your demands and business grow, then add resources like block storage and automatic back-ups later on. Each service on DigitalOcean can be transferred to different droplets and within data-center regions for optimized networking.&lt;/p&gt;

&lt;p&gt;The initial thing members are asked to do when creating a droplet is to choose an image. Choices range from popular &lt;a href="https://www.techradar.com/news/best-linux-distro"&gt;Linux distributions&lt;/a&gt;, like Ubuntu 18.04 x64 to Debian and CentOS. Container distributions include CoreOS, Fedora Atomic, and RancherOS.&lt;/p&gt;

&lt;p&gt;DigitalOcean provides developers a robust marketplace for one-click configurations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Few of DigitalOcean’s Marketplace Image Choices&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Akaunting&lt;/strong&gt; ; free accounting distribution. Modular design and quick deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claudron&lt;/strong&gt; ; an end-to-end solution for running a host of familiar applications. Automated DNS and user management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cPanel&lt;/strong&gt; and WHM; one of the most popular website user management solutions available. The app allows developers to build websites, create emails, and maintain their domains.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discourse&lt;/strong&gt; ; next generation discussion forum.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker&lt;/strong&gt; ; a global brand for container production and administration. Plenty of support and tutorials come with this distribution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ghost&lt;/strong&gt; ; a platform to build modern blogs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitLab Enterprise&lt;/strong&gt; ; end-to-end developer automation. Source code and unlimited scaling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mastodon&lt;/strong&gt; ; create a framework for all your social development needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NodeJS&lt;/strong&gt; ; build scalable networks across distributed devices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shopware&lt;/strong&gt; ; next-generation e-commerce platform. Combine with a WordPress droplet to provide incredible flexibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After choosing a model for your droplet, determine the best plan for your application. 1) Starter; optimized for modest projects such as blogs and developer testing. 2) Performance; broken down into a General Purpose, or CPU Optimized virtual machine.&lt;/p&gt;

&lt;p&gt;DigitalOcean offers members and developers a huge number of programs and compositions. Developers can customize each subscription plan throughout the configuration process and each method provides automatic scaling.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Few DigitalOcean Value Oriented Hosting Plans + Promo Codes and Coupons
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Standard Configuration&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;$5 mo. or $.007 per hour: 1) 1 GB/1 CPU. 2) 25 GB SSD Disk. 3) 1000 GB Transfer.&lt;/li&gt;
&lt;li&gt;$80 mo. or $.119 hour: 1) 16 GB/ 6 CPU’s. 2) 320 GB SSD Disk. 3) 6 TB Transfer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Performance Configuration&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;$240 mo. or $.357 hour: 1) 32 GB/8 CPU’s. 2) 100 GB SSD Disk. 3) 6 TB Transfer.&lt;/li&gt;
&lt;li&gt;$1200 mo. or $1.786 hour: 1) 160 GB/ 40 CPU’s. 2) 500 GB SSD Disk. 3) 9 TB Transfer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The above hosting configurations are individual droplet plans. Just remember to use my link to get yourself the $50 promo code when signing up. Digital Ocean does a commendable job of bringing value to their services, such as data transport is per account rather than each droplet. Also don’t forget to use a DigitalOcean promo code and get the $50 in free credit applied to your account.&lt;/p&gt;

&lt;p&gt;DigitalOcean provides a unique solution for developers needing more storage without adding additional processing power and cost. Block Storage acts as a generic device linked to any droplet. Block storage has several practical functions for rapid deployment within a droplet. 1) Temporary backups 2) RAID Arrays 3) Web server.&lt;/p&gt;

&lt;p&gt;Choose an available data center point along with other options, such as a private network and monitoring tools. Developers can include an &lt;a href="https://en.wikipedia.org/wiki/Secure_Shell"&gt;SSH key&lt;/a&gt; to their droplet for root entry if extra security is called for.&lt;/p&gt;

&lt;p&gt;Choose your host name for the project, add tags for easy lookup later on and hit the “create” button. There you have it, a customized production ready VPS solution with unlimited scaling ability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kubernetes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The open-sourced cluster management tool developed by Google in 2014 is spreading to every corner of the globe, Fast!. Developers are discovering time to production for their applications have been cut dramatically. Every cloud-hosting company provides some type of &lt;a href="https://kubernetes.io/"&gt;Kubernetes&lt;/a&gt; management tool along with Docker integration. DigitalOcean provides an easy to configure, cluster production and administration tool. Members with little to no experience, find the process of creating a DigitalOcean Kubernetes cluster easy and natural.&lt;/p&gt;

&lt;p&gt;Full production documents, tutorials, and a complete resource center are made available to any member willing to learn this fascinating platform. Creating a Kubernetes cluster is easier to create than a droplet if you can imagine that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Design a Cluster in the DigitalOcean Dashboard&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Determine which Kubernetes version you prefer, the latest is 1.14.2-do.0&lt;/li&gt;
&lt;li&gt;Select an available data center.&lt;/li&gt;
&lt;li&gt;Decide on capacity, machine type, memory, and your desired number of nodes. Digital Ocean makes it easy to build additional nodes at setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Choose your name for the project, click “create cluster” and you have a production ready Kubernetes Cluster environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DigitalOcean API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The DigitalOcean API is a powerful control mechanism like no other cloud-hosting platform. Manage droplets and all other DigitalOcean services using HTTP requests. Using the API, developers can generate requests by the GET method.&lt;/p&gt;

&lt;p&gt;Some of the intelligence developers can obtain by applying the DigitalOcean API:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Account status.&lt;/li&gt;
&lt;li&gt;Domain records.&lt;/li&gt;
&lt;li&gt;Droplet information.&lt;/li&gt;
&lt;li&gt;Kubernetes cluster information.&lt;/li&gt;
&lt;li&gt;Project resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Networking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DigitalOcean has taken value oriented networking services to a new standard. Along with the typical internet protocols, DigitalOcean provides “Private Networking” The service allows a supplementary network interface not opened to the internet.&lt;/p&gt;

&lt;p&gt;Private networking lets droplets interact with one another within the same geographic region. Network traffic to and from a private network does not count toward a monthly bandwidth cap.&lt;/p&gt;

&lt;p&gt;Floating IP is another extraordinary component to networking within DigitalOcean. A Floating IP is a static address, which gives developers the capability to move network traffic to any droplet. Developers can configure the protocol when constructing their droplet.&lt;/p&gt;

&lt;p&gt;Load balancers let a developer distribute network traffic across virtual servers and geographic zones. Unlike other platforms, DigitalOcean manages its load balancer with no setup or user configuration necessary. Like all other services, the DigitalOcean API can access and administer network protocols and their status.&lt;/p&gt;

&lt;p&gt;DigitalOcean continues to dominate its smaller rivals by a large margin. Will the cloud-hosting provider from the east ever be as vast a beast as other major players in the space? Let’s hope not. Considering you can use the DigitalOcean promo code to get a free chunk of hosting credit, it’s really a no brainer.&lt;/p&gt;

&lt;h3&gt;
  
  
  –&amp;gt;&amp;gt; &lt;a href="http://bit.ly/2B5ReJR"&gt;Get your $50 in FREE hosting credit HERE&lt;/a&gt;
&lt;/h3&gt;

</description>
      <category>servers</category>
      <category>serverless</category>
      <category>hosting</category>
      <category>digitalocean</category>
    </item>
    <item>
      <title>Drawing a Minion with CSS</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Fri, 29 Mar 2019 18:18:07 +0000</pubDate>
      <link>https://dev.to/geeksamu/drawing-a-minion-with-css-4bp0</link>
      <guid>https://dev.to/geeksamu/drawing-a-minion-with-css-4bp0</guid>
      <description>&lt;p&gt;Quick Video on how I created a Minion with CSS&lt;/p&gt;

&lt;blockquote class="twitter-tweet" data-lang="en"&gt;
&lt;p&gt;Drawing Minion with &lt;a href="https://twitter.com/hashtag/css?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#css&lt;/a&gt;&lt;a href="https://twitter.com/hashtag/css3?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#css3&lt;/a&gt; &lt;a href="https://t.co/eOcvteabzm"&gt;pic.twitter.com/eOcvteabzm&lt;/a&gt;&lt;/p&gt;— Ahmed ⚯͛ (&lt;a class="comment-mentioned-user" href="https://dev.to/geeksamu"&gt;@geeksamu&lt;/a&gt;
) &lt;a href="https://twitter.com/geeksamu/status/1111360066681212936?ref_src=twsrc%5Etfw"&gt;March 28, 2019&lt;/a&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here's the code &lt;a href="https://codepen.io/geeksamu/pen/OqKRom"&gt;https://codepen.io/geeksamu/pen/OqKRom&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>css3</category>
    </item>
    <item>
      <title>Why I built Medium Plus</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Tue, 05 Feb 2019 22:40:39 +0000</pubDate>
      <link>https://dev.to/geeksamu/why-i-built-medium-plus-47n9</link>
      <guid>https://dev.to/geeksamu/why-i-built-medium-plus-47n9</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AmQW5TgzGYF7-w7Y-gpA8LQ.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AmQW5TgzGYF7-w7Y-gpA8LQ.png"&gt;&lt;/a&gt;&lt;a href="https://medium.com" rel="noopener noreferrer"&gt;source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hello guys,&lt;/p&gt;

&lt;p&gt;I’m &lt;a href="https://wb.gy" rel="noopener noreferrer"&gt;Ahmed Abdelsalam&lt;/a&gt;, A freelance Web Developer, Blogger, and TEDx Speaker.&lt;/p&gt;

&lt;p&gt;I changed the theme of &lt;a href="https://blog.wb.gy" rel="noopener noreferrer"&gt;my blog&lt;/a&gt; at the end of 2018, Building a simpler theme with better typography, multiple themes, and other features. After finishing the theme I said to myself why don’t we have similar features for a great website like  &lt;strong&gt;Medium&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Features Like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dark theme.&lt;/li&gt;
&lt;li&gt;Customizable font-family.&lt;/li&gt;
&lt;li&gt;Customizable font-size.&lt;/li&gt;
&lt;li&gt;Offline Articles.&lt;/li&gt;
&lt;li&gt;Highlighted Code.&lt;/li&gt;
&lt;li&gt;Listen to articles instead of reading.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these features will make my medium experience better. Besides, finishing more articles listening to them at any time.&lt;/p&gt;

&lt;p&gt;In the beginning, I thought about creating a chrome extension to add all these options to Medium, but It took me some time to realize that I can’t use this extension on my phone. I prefer reading on my phone, so I decided to create a tool that gets the article from Medium and enhances it with all the features above.&lt;/p&gt;

&lt;p&gt;I know it’s not perfect, but I really tried so hard to do my best building every piece of this tool.&lt;/p&gt;

&lt;p&gt;Let’s talk about each feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dark Theme
&lt;/h3&gt;

&lt;p&gt;I built a second dark theme, as I prefer the dark themes at everything. It won’t stop at the currently light and dark themes. I’m planning to build more themes that fit everybody. It means that if you want to use &lt;a href="https://mplus.wb.gy" rel="noopener noreferrer"&gt;&lt;strong&gt;Medium Plus&lt;/strong&gt;&lt;/a&gt; and want to use your own &lt;strong&gt;color Schema,&lt;/strong&gt; Just &lt;a href="https://wb.gy" rel="noopener noreferrer"&gt;contact me&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’s an example&lt;/p&gt;

&lt;h3&gt;
  
  
  Different Font Families
&lt;/h3&gt;

&lt;p&gt;Medium uses a good font family but I prefer to use others and choose what I want whenever I want. That’s why I created this feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  Font-Size Control (soon)
&lt;/h3&gt;

&lt;p&gt;I’m planning to add a font-size control soon so you can choose the font-size you prefer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Offline Articles
&lt;/h3&gt;

&lt;p&gt;Every article you load in &lt;a href="https://mplus.wb.gy/" rel="noopener noreferrer"&gt;&lt;strong&gt;Medium Plus&lt;/strong&gt;&lt;/a&gt; is saved in your browser cache so you can access them whenever you want, even without internet connection. All you need is to just load the article once.&lt;/p&gt;

&lt;h3&gt;
  
  
  Highlighted Code
&lt;/h3&gt;

&lt;p&gt;This is one of the hardest features to build, I tried to make the code syntax highlighting experience better than it is on Medium. I just want to read the code better here instead of hosting code on GitHub Gist. Next, I’ll post some code to show you the difference between Medium and &lt;a href="https://mplus.wb.gy/" rel="noopener noreferrer"&gt;&lt;strong&gt;Medium Plus&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { Component } from 'react'
export default class App extends Component {
 render() {
 return (
 \&amp;lt;div\&amp;gt;
 Hello Medium Plus
 \&amp;lt;/div\&amp;gt;
 )
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It took me some time to be able to use highlight.js in &lt;a href="https://mplus.wb.gy/" rel="noopener noreferrer"&gt;&lt;strong&gt;Medium Plus&lt;/strong&gt;&lt;/a&gt; and use its amazing features of code highlighting.&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1001%2F1%2AJRVw-6vs9DCofB7WbNyjzQ.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%2Fcdn-images-1.medium.com%2Fmax%2F1001%2F1%2AJRVw-6vs9DCofB7WbNyjzQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Articles to Audio
&lt;/h3&gt;

&lt;p&gt;Medium has a lot of amazing content, I really want to read more and more but I don’t have the time to finish reading all these lists of articles. Having the option to listen to your articles instead of reading them will save you a lot of time. I used a service called &lt;a href="https://goo.gl/W1Yg9h" rel="noopener noreferrer"&gt;WebsiteVoice&lt;/a&gt; to add this feature to &lt;a href="https://mplus.wb.gy/" rel="noopener noreferrer"&gt;&lt;strong&gt;Medium Plus&lt;/strong&gt;&lt;/a&gt;.&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AUdS3iB47YMSF6_KnTipwmg.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AUdS3iB47YMSF6_KnTipwmg.gif"&gt;&lt;/a&gt;Medium Plus Image&lt;/p&gt;

&lt;h3&gt;
  
  
  My Plans
&lt;/h3&gt;

&lt;p&gt;I’m planning to make this tool open-source as soon as possible, adding more features and I’d be really happy to add any suggestions from you guys, so don’t hesitate to leave me comments or emails.&lt;/p&gt;

&lt;h3&gt;
  
  
  Disadvantages of Medium Plus
&lt;/h3&gt;

&lt;p&gt;The only problem I have now with Medium Plus is the embedded code, for example: (IFrames) Like Github Gists. Medium hosts this stuff on their media and prevents accessing them from an external domain (CORS) that’s why I can’t use them. At the moment I’m working on this issue.&lt;/p&gt;

&lt;p&gt;Try it yourself &lt;a href="https://mplus.wb.gy/" rel="noopener noreferrer"&gt;&lt;strong&gt;Medium Plus&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>medium</category>
      <category>javascript</category>
      <category>react</category>
      <category>node</category>
    </item>
    <item>
      <title>Deploy Angular 6 Application to Netlify</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Sun, 06 May 2018 11:38:53 +0000</pubDate>
      <link>https://dev.to/geeksamu/deploy-angular-6-application-to-netlify-48g2</link>
      <guid>https://dev.to/geeksamu/deploy-angular-6-application-to-netlify-48g2</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AByAhY7BtpARVPzkgM6yV1Q.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AByAhY7BtpARVPzkgM6yV1Q.png"&gt;&lt;/a&gt;&lt;strong&gt;Deploy Angular 6 Application to Netlify&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the fourth part in an n-part &lt;a href="https://dev.to/geeksamu/angular-6-article-series-2n26-temp-slug-5101921"&gt;series&lt;/a&gt; about the JavaScript framework, Angular 6.&lt;br&gt;&lt;br&gt;
In this part, we'll go over deplying our Angular 6 application to Netlify.&lt;/p&gt;

&lt;p&gt;This is not intended to be a complete guide, but rather an overview of the basics to get you up and running so you can get to know Deployment on Netlify and how to deploy your Angular 6 application to it.&lt;br&gt;&lt;br&gt;
I'm going to deploy the application We created in the 3 previous articles, so you have to check them first!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Before we begin, English is not my first language, so if you see something weird, please, calmly point it out in the comment section or&lt;/em&gt; &lt;a href="//mailto:i@wb.gy"&gt;&lt;em&gt;email me&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, there’s no need for violence :)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Article Series
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/geeksamu/angular-6-article-series-2n26-temp-slug-5101921"&gt;Angular 6 Article Series&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/geeksamu/building-angular-6-application-bf9-temp-slug-3458718"&gt;Building Angular 6 Application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/geeksamu/using-angular-material-with-angular-6-lob-temp-slug-9844819"&gt;Using Angular Material with Angular 6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Deploy Angular 6 Application to Netlify ( &lt;strong&gt;You’re here&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Creating PWA with Angular 6 ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Dynamic themes in Angular 6 Material ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Angular 6 with GSAP ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Angular 6 with Firebase ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Deploy our application to github
&lt;/h3&gt;

&lt;p&gt;First we need to deploy our application to our github account.&lt;br&gt;&lt;br&gt;
You have to create new repository from &lt;a href="https://github.com/new" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AiTC5Dl8vgTIubNWR.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AiTC5Dl8vgTIubNWR.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating your repository you should see a page like this but the name of the repo would be different&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AGAAQJ2B3uWbGn-BZ.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AGAAQJ2B3uWbGn-BZ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now open you terminal and change your current directory to our app’s directory.&lt;br&gt;&lt;br&gt;
and run the next lines of code but you have to change the repo name to your repo's name.&lt;br&gt;&lt;br&gt;
To add all our changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add -A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then we have to commit these changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "First commit before deployment"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can change the commit title as you want.&lt;br&gt;&lt;br&gt;
Next we have to run:&lt;br&gt;&lt;br&gt;
==but please don’t forget to change the repo-name and the username ==&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin git@github.com:your-username-here/your-repo-name-here.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;~ Change your-username-here and your-repo-name-here in the previous code to yours first.&lt;br&gt;&lt;br&gt;
Now let's push our changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push -u origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Netlify
&lt;/h3&gt;

&lt;p&gt;Netlify is one of the most beautiful things I’ve seen lately. Actually, I wish that I had used it before. It offers a lot of amazing features.&lt;/p&gt;

&lt;p&gt;I have deployed my own &lt;a href="https://wb.gy" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; on it. you can check it out from here &lt;a href="https://wb.gy" rel="noopener noreferrer"&gt;wb.gy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It offers hosting for &lt;strong&gt;Front-end&lt;/strong&gt; projects with many options. I can’t count them in this article, so you will have to check them for yourself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploying to Netlify
&lt;/h3&gt;

&lt;p&gt;Let’s back to our deployment, you have to create an account on &lt;a href="https://app.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; first using [Github, Gitlab, Bitbucket or Email] Choose what you want.&lt;br&gt;&lt;br&gt;
After that you'll be redirected to create your site&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AzazFtXyv83YSkKrW.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AzazFtXyv83YSkKrW.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on New site from Git&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AsBifB82JSbM2qUrG.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AsBifB82JSbM2qUrG.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now choose Github, if you're using another git system choose it.&lt;/p&gt;

&lt;p&gt;Next, choose your repo. I’ll deploy a repo named angular-6-article-series&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AXWiOncSYjX9EGZCl.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AXWiOncSYjX9EGZCl.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next we have to set some settings for our deployment.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;For branch choose master, If you're using different branch choose it.&lt;/li&gt;
&lt;li&gt;For Build command type
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng build --prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This command I’ll explain it later in our series&lt;/p&gt;

&lt;p&gt;For Publish directory, type: dist/your-application-name&lt;/p&gt;

&lt;p&gt;Don’t forget to replace your-application-name with the name of your application here my application name is angular-6-series&lt;/p&gt;

&lt;p&gt;In Angular previous version it was just the ‘dist’ directory but now the CLI will create new folder into dist with the name of your application&lt;br&gt;&lt;br&gt;
Why dist exactly, it's the directory angular creates when you run ng build so it's our application's directory.&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AUYyvLr7AdS0iT_nS.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AUYyvLr7AdS0iT_nS.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then click Deploy site&lt;br&gt;&lt;br&gt;
It'll take a minute to deploy our site and give us the URL.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I solved the next problem!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This should work and your application will be deployed successfully, But mines does not work. I don’t know why! I see no errors. No problems. So I tried to deploy it using any method&lt;br&gt;&lt;br&gt;
If your application gives you 404 page. You can deploy your final dist folder only to Nelify.&lt;br&gt;&lt;br&gt;
Just run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng build --prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It’ll create dist folder. Just drag it and drop it on this part of page in `Netlify&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AwwzeBi2SWTSIVFvM.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AwwzeBi2SWTSIVFvM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This solution will work but it’s not the best. We won’t be able to use Netlify's continuous deployment&lt;/p&gt;

&lt;p&gt;Here’s my deployment URL &lt;a href="https://angular6-series.netlify.com/" rel="noopener noreferrer"&gt;https://angular6-series.netlify.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know that the explanation with images in this article might be silly, but I really wanted it to be understood, so the next articles would be more simple and anyone with little experience would be able to build the final application.&lt;/p&gt;

&lt;p&gt;Next: Creating PWA with Angular 6 ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/p&gt;

&lt;h3&gt;
  
  
  If you liked this article, hit that clap button below 👏. check out other articles I’ve written &lt;a href="https://blog.wb.gy" rel="noopener noreferrer"&gt;here&lt;/a&gt;. And If you find this story useful. As I don’t use Medium Partner Program. Buy me a coffee :)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;Buy Ahmed Abdelsalam a Coffee. ko-fi.com/geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any question comment it below or You can find me on Twitter &lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;@geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;Ahmed ⚯͛ (@geeksamu) | Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>angular4</category>
      <category>angular6</category>
    </item>
    <item>
      <title>Using Angular Material with Angular 6</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Sat, 05 May 2018 17:37:52 +0000</pubDate>
      <link>https://dev.to/geeksamu/using-angular-material-with-angular-6-78p</link>
      <guid>https://dev.to/geeksamu/using-angular-material-with-angular-6-78p</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AByAhY7BtpARVPzkgM6yV1Q.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AByAhY7BtpARVPzkgM6yV1Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the third part in an n-part &lt;a href="https://blog.wb.gy/angular-6-article-series/" rel="noopener noreferrer"&gt;series&lt;/a&gt; about the JavaScript framework, Angular 6.&lt;br&gt;&lt;br&gt;
In this part, we'll go over using Angular Material with Angular 6 Applicatin.&lt;/p&gt;

&lt;p&gt;This is not intended to be a complete guide, but rather an overview of the basics to get you up and running so you can get to know using Angular Material and how to use it with our Angular 6 application.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Before we begin, English is not my first language, so if you see something weird, please, calmly point it out in the comment section or&lt;/em&gt; &lt;a href="//mailto:i@wb.gy"&gt;&lt;em&gt;email me&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, there’s no need for violence :)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Article Series
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/geeksamu/angular-6-article-series-2n26-temp-slug-5101921"&gt;Angular 6 Article Series&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/geeksamu/building-angular-6-application-bf9-temp-slug-3458718"&gt;Building Angular 6 Application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Using Angular Material with Angular 6 ( &lt;strong&gt;You’re here&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/deploy-angular-6-application-to-netlify-60b39b9df61c" rel="noopener noreferrer"&gt;Deploy Angular 6 Application to Netlify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Creating PWA with Angular 6 ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Dynamic themes in Angular 6 Material ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Angular 6 with GSAP ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Angular 6 with Firebase ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First you must check the previous article in this series to create new Angular6 Application.&lt;br&gt;&lt;br&gt;
Now using the new ng add in Angular-CLI let's install the Angular Material. In your application root directory run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng add @angular/material @angular/cdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It updated the package.json and angular.json&lt;br&gt;&lt;br&gt;
Added BrowserAnimationsModule to your app.module.ts file&lt;br&gt;&lt;br&gt;
Added Material Icons,Roboto Font to index.html&lt;/p&gt;

&lt;p&gt;You can generate a starter component including a toolbar and a side navigation.&lt;br&gt;&lt;br&gt;
Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng generate @angular/material:material-nav --name=navbar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will generate a component named navbar and will add some material components to app.module.ts.&lt;/p&gt;

&lt;p&gt;Let’s add our navbar to app.component.html&lt;br&gt;&lt;br&gt;
Open /src/app/app.component.html and add the navbar tag, your code should look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\&amp;lt;navbar\&amp;gt;\&amp;lt;/navbar\&amp;gt;
\&amp;lt;router-outlet\&amp;gt;\&amp;lt;/router-outlet\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you’re running a server for our app check your browser or run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng serve --open
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to see the changes we made.&lt;/p&gt;

&lt;p&gt;But I think there’s something wrong with our menu. I fixed it and changed the links of the menu by adding our home and posts routes.&lt;br&gt;&lt;br&gt;
Here’s the final code of /src/app/navbar/navbar.component.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\&amp;lt;mat-sidenav-container class="sidenav-container"\&amp;gt;
 \&amp;lt;mat-sidenav
 #drawer
 class="sidenav"
 fixedInViewport="true"
 [attr.role]="isHandset ? 'dialog' : 'navigation'"
 [mode]="(isHandset | async)!.matches ? 'over' : 'side'"
 [opened]="!(isHandset | async)!.matches"\&amp;gt;
 \&amp;lt;mat-toolbar color="primary"\&amp;gt;Menu\&amp;lt;/mat-toolbar\&amp;gt;
 \&amp;lt;mat-nav-list\&amp;gt;
 \&amp;lt;a mat-list-item routerLink="/"\&amp;gt;Home\&amp;lt;/a\&amp;gt;
 \&amp;lt;a mat-list-item routerLink="posts"\&amp;gt;Posts\&amp;lt;/a\&amp;gt;
 \&amp;lt;/mat-nav-list\&amp;gt;
 \&amp;lt;/mat-sidenav\&amp;gt;
 \&amp;lt;mat-sidenav-content\&amp;gt;
 \&amp;lt;mat-toolbar color="primary"\&amp;gt;
 \&amp;lt;button
 type="button"
 aria-label="Toggle sidenav"
 mat-icon-button
 (click)="drawer.toggle()"
 \&amp;gt;
 \&amp;lt;mat-icon aria-label="Side nav toggle icon"\&amp;gt;menu\&amp;lt;/mat-icon\&amp;gt;
 \&amp;lt;/button\&amp;gt;
 \&amp;lt;span\&amp;gt;Application Title\&amp;lt;/span\&amp;gt;
 \&amp;lt;/mat-toolbar\&amp;gt;
 \&amp;lt;/mat-sidenav-content\&amp;gt;
\&amp;lt;/mat-sidenav-container\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also generate a starter dashboard component containing a dynamic grid list of cards.&lt;br&gt;&lt;br&gt;
Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng generate @angular/material:material-dashboard --name=dash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see the result by adding &amp;lt;dash&amp;gt;&amp;lt;/dash&amp;gt; tag to your app.component.html&lt;br&gt;&lt;br&gt;
Your final /src/app/app.component.html should look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\&amp;lt;navbar\&amp;gt;\&amp;lt;/navbar\&amp;gt;
\&amp;lt;dash\&amp;gt;\&amp;lt;/dash\&amp;gt;
\&amp;lt;router-outlet\&amp;gt;\&amp;lt;/router-outlet\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ALTWyNQpTYWCEsaWy.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ALTWyNQpTYWCEsaWy.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can generate a starter data table component that is pre-configured with a datasource for sorting and pagination.&lt;br&gt;&lt;br&gt;
Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng generate @angular/material:material-table --name=data-table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And add it like the previous one to see the results.&lt;/p&gt;

&lt;p&gt;This new features of Angular 6 are cool but I prefer to put all the Material Modules in separated file named material.module.ts and I prefer to import most of the modules once. I don't like importing one by one. I know that it's not the best practice&lt;br&gt;&lt;br&gt;
So Let's edit our app.module.ts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { PostsComponent } from './posts/posts.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialModule } from './material.module';

import { NavbarComponent } from './navbar/navbar.component';
import { LayoutModule } from '@angular/cdk/layout';
import { DashComponent } from './dash/dash.component';
import { DataTableComponent } from './data-table/data-table.component';

@NgModule({
 declarations: [
 AppComponent,
 HomeComponent,
 PostsComponent,
 NavbarComponent,
 DashComponent,
 DataTableComponent
 ],
 imports: [
 BrowserModule,
 AppRoutingModule,
 BrowserAnimationsModule,
 MaterialModule,
 LayoutModule
 ],
 providers: [],
 bootstrap: [AppComponent]
})
export class AppModule { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and create new file /src/app/material.module.ts and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { NgModule } from '@angular/core';

import {
 MatButtonModule,
 MatMenuModule,
 MatToolbarModule,
 MatIconModule,
 MatCardModule,
 MatGridListModule,
 MatSidenavModule,
 MatSortModule,
 MatTableModule,
 MatInputModule,
 MatSelectModule,
 MatSliderModule,
 MatRadioModule,
 MatListModule,
 MatProgressSpinnerModule,
 MatChipsModule,
 MatTooltipModule,
 MatExpansionModule,
 MatDialogModule,
 MatAutocompleteModule,
 MatTabsModule,
 MatSlideToggleModule,
 MatPaginatorModule

} from '@angular/material';

@NgModule({
 imports: [
 MatButtonModule,
 MatMenuModule,
 MatToolbarModule,
 MatIconModule,
 MatCardModule,
 MatGridListModule,
 MatSidenavModule,
 MatSortModule,
 MatTableModule,
 MatInputModule,
 MatSelectModule,
 MatSliderModule,
 MatRadioModule,
 MatListModule,
 MatProgressSpinnerModule,
 MatChipsModule,
 MatTooltipModule,
 MatExpansionModule,
 MatDialogModule,
 MatAutocompleteModule,
 MatTabsModule,
 MatSlideToggleModule,
 MatPaginatorModule

],
 exports: [
 MatButtonModule,
 MatMenuModule,
 MatToolbarModule,
 MatIconModule,
 MatCardModule,
 MatGridListModule,
 MatSidenavModule,
 MatSortModule,
 MatTableModule,
 MatInputModule,
 MatSelectModule,
 MatSliderModule,
 MatRadioModule,
 MatListModule,
 MatProgressSpinnerModule,
 MatChipsModule,
 MatTooltipModule,
 MatExpansionModule,
 MatDialogModule,
 MatAutocompleteModule,
 MatTabsModule,
 MatSlideToggleModule,
 MatPaginatorModule

]
})
export class MaterialModule {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we need to include *HammerJS for gesture support.&lt;br&gt;&lt;br&gt;
In your terminal, type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save hammerjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have to include it, open /src/main.ts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import 'hammerjs';

if (environment.production) {
 enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
 .catch(err =\&amp;gt; console.log(err));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I have to mention something as I know you might face a problem while using it.&lt;br&gt;&lt;br&gt;
Now we have 2 modules in our application ( app.module.ts and material.module.ts), so if you want to create new component or service you have to mention where do you want to add your new component.&lt;br&gt;&lt;br&gt;
Let's see a practical example. If we want to create new component named test&lt;br&gt;&lt;br&gt;
in your terminal run( make sure you're in your root directory first):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng g component test --module app.module.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create new component named test and will add it to app.module.ts.&lt;/p&gt;

&lt;p&gt;If you forgot to add the --module argument you'll get an error next time adding new component.&lt;/p&gt;

&lt;p&gt;That’s all for now&lt;/p&gt;

&lt;p&gt;Next: &lt;a href="https://medium.com/@geeksamu/deploy-angular-6-application-to-netlify-60b39b9df61c" rel="noopener noreferrer"&gt;Deploy Angular 6 Application to Netlify&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  If you liked this article, hit that clap button below 👏. check out other articles I’ve written &lt;a href="https://blog.wb.gy" rel="noopener noreferrer"&gt;here&lt;/a&gt;. And If you find this story useful. As I don’t use Medium Partner Program. Consider a donation through &lt;a href="http://paypal.me/geeksamu" rel="noopener noreferrer"&gt;PayPal&lt;/a&gt;, or &lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;&lt;em&gt;‘Buy Me a Coffee'&lt;/em&gt;&lt;/a&gt; :)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;Buy Ahmed Abdelsalam a Coffee. ko-fi.com/geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any question comment it below or You can find me on Twitter &lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;@geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;Ahmed ⚯͛ (@geeksamu) | Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>angular6</category>
      <category>angular4</category>
    </item>
    <item>
      <title>Building Angular 6 Application</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Sat, 05 May 2018 15:38:12 +0000</pubDate>
      <link>https://dev.to/geeksamu/building-angular-6-application-3icb</link>
      <guid>https://dev.to/geeksamu/building-angular-6-application-3icb</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AByAhY7BtpARVPzkgM6yV1Q.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AByAhY7BtpARVPzkgM6yV1Q.png"&gt;&lt;/a&gt;angular 6 series&lt;/p&gt;

&lt;p&gt;This is the second part in an n-part &lt;a href="https://dev.to/geeksamu/angular-6-article-series-2n26-temp-slug-5101921"&gt;series&lt;/a&gt; about the JavaScript framework, Angular 6.&lt;br&gt;&lt;br&gt;
In this part, we'll go over build new Angular 6 Applicatin.&lt;/p&gt;

&lt;p&gt;This is not intended to be a complete guide, but rather an overview of the basics to get you up and running so you can get to know using Angular CLI and how to build your Angular 6application using it.&lt;/p&gt;
&lt;h3&gt;
  
  
  Article Series
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/geeksamu/angular-6-article-series-2n26-temp-slug-5101921"&gt;Angular 6 Article Series&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Building Angular 6 Application ( &lt;strong&gt;You’re here&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-6-862a1c3d04b" rel="noopener noreferrer"&gt;Using Angular Material with Angular 6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/deploy-angular-6-application-to-netlify-60b39b9df61c" rel="noopener noreferrer"&gt;Deploy Angular 6 Application to Netlify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Creating PWA with Angular 6 ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Dynamic themes in Angular 6 Material ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Angular 6 with GSAP ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Angular 6 with Firebase ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Upgrading Angular-CLI
&lt;/h3&gt;

&lt;p&gt;I assume that you have nodejs and npm installed. If not you have to install them first. Just Google it.&lt;/p&gt;

&lt;p&gt;First we need to upgrade our CLI or install it for the first time. The next command will install it or upgrade your current version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g @angular/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Creating new Angular App
&lt;/h4&gt;

&lt;p&gt;Now We want to use CLI to create new Angular 6 Application. Change your directory where you want to create the new app, then run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng new angular6-series --routing --style=scss --skip-tests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where angular6-series is our application's name. But we have some arguments here.&lt;br&gt;&lt;br&gt;
Let's Explain each argument of our command&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;--routing: It builds our routes so I won't have to build them myself&lt;/li&gt;
&lt;li&gt;--style=scss: It changes our styling extension from css to scss as I prefer sass.&lt;/li&gt;
&lt;li&gt;--skip-tests: to skip creating tests files. But You may need them in this case you have to remove this argument.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But If you want to build your application normally without all these options, just run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng new angular6-series
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating our new app. Move the app directory and run the server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd angular6-series
ng serve --open
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ng serve will run the server of our app and the argument --open will open it in the default browser.&lt;br&gt;&lt;br&gt;
Now you should see this in your browser&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A2y0SONIf8kaLLPnH.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A2y0SONIf8kaLLPnH.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Creating Components
&lt;/h4&gt;

&lt;p&gt;Let’s create new component named home and make it our home page with some content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng g c home
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create the component files. But you’ll see no change in your app. Let’s modify our src/app/app.component.html&lt;br&gt;&lt;br&gt;
Remove all the code and leave the last tag. It should look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\&amp;lt;router-outlet\&amp;gt;\&amp;lt;/router-outlet\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now open /src/app/app-routing.module.ts&lt;br&gt;&lt;br&gt;
I want to add the new component as the home page.&lt;br&gt;&lt;br&gt;
We need to import the HomeComponent and add the route to routes array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';

const routes: Routes = [
 {
 path: "",
 component: HomeComponent
 },
];

@NgModule({
 imports: [RouterModule.forRoot(routes)],
 exports: [RouterModule]
})
export class AppRoutingModule { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should see your home component content in your home page.&lt;br&gt;&lt;br&gt;
Let’s edit our HomeComponent open /src/app/home/home.component.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\&amp;lt;h1\&amp;gt;
 Welcome to our Angular 6 Application
\&amp;lt;/h1\&amp;gt;
\&amp;lt;p\&amp;gt;
 Lorem ipsum dolor sit amet consectetur adipisicing elit. Assumenda repudiandae repellat perferendis corrupti, harum provident
 ipsam illo laudantium magni deleniti corporis modi error aperiam iure molestiae eligendi quo voluptatem minus?
\&amp;lt;/p\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s create another component named posts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng g c posts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First we need to add new route for our posts component&lt;br&gt;&lt;br&gt;
open /src/app/app-routing.module.ts and do like we did to the home component&lt;br&gt;&lt;br&gt;
our file should look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { PostsComponent } from './posts/posts.component';

const routes: Routes = [
 {
 path: "",
 component: HomeComponent
 },
 {
 path: "posts",
 component: PostsComponent
 },
];

@NgModule({
 imports: [RouterModule.forRoot(routes)],
 exports: [RouterModule]
})
export class AppRoutingModule { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now open /src/app/posts/posts.component.html&lt;br&gt;&lt;br&gt;
and add some html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\&amp;lt;div class="post"\&amp;gt;
 \&amp;lt;h1\&amp;gt;Post title here\&amp;lt;/h1\&amp;gt;
 \&amp;lt;p\&amp;gt;Lorem ipsum dolor sit amet consectetur adipisicing elit. Mollitia minima soluta harum fugit neque accusamus non fuga blanditiis quam enim nemo, quia dolores iure explicabo officia, cumque expedita quis sint.\&amp;lt;/p\&amp;gt;
\&amp;lt;/div\&amp;gt;
\&amp;lt;div class="post"\&amp;gt;
 \&amp;lt;h1\&amp;gt;Post title here\&amp;lt;/h1\&amp;gt;
 \&amp;lt;p\&amp;gt;Lorem ipsum dolor sit amet consectetur adipisicing elit. Mollitia minima soluta harum fugit neque accusamus non fuga blanditiis quam enim nemo, quia dolores iure explicabo officia, cumque expedita quis sint.\&amp;lt;/p\&amp;gt;
 \&amp;lt;/div\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see our new component in the browser by visiting: &lt;a href="http://localhost:4200/posts" rel="noopener noreferrer"&gt;http://localhost:4200/posts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s all for now.&lt;/p&gt;

&lt;p&gt;Next: &lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-6-862a1c3d04b" rel="noopener noreferrer"&gt;Using Angular Material with Angular 6&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  If you liked this article, hit that clap button below 👏. check out other articles I’ve written &lt;a href="https://blog.wb.gy" rel="noopener noreferrer"&gt;here&lt;/a&gt;. And If you find this story useful. As I don’t use Medium Partner Program. Consider a donation through &lt;a href="http://paypal.me/geeksamu" rel="noopener noreferrer"&gt;PayPal&lt;/a&gt;, or &lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;‘Buy Me a Coffee’&lt;/a&gt; :)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;Buy Ahmed Abdelsalam a Coffee. ko-fi.com/geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any question comment it below or You can find me on Twitter &lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;@geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;Ahmed ⚯͛ (@geeksamu) | Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>javascript</category>
      <category>angular2</category>
      <category>angular4</category>
    </item>
    <item>
      <title>Angular 6 Article Series</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Sat, 05 May 2018 15:37:44 +0000</pubDate>
      <link>https://dev.to/geeksamu/angular-6-article-series-5e60</link>
      <guid>https://dev.to/geeksamu/angular-6-article-series-5e60</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AByAhY7BtpARVPzkgM6yV1Q.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AByAhY7BtpARVPzkgM6yV1Q.png"&gt;&lt;/a&gt;angular 6 series&lt;/p&gt;

&lt;p&gt;I published &lt;a href="https://medium.com/@geeksamu/angular-5-article-series-a614d38b12ad" rel="noopener noreferrer"&gt;article series&lt;/a&gt; days ago about angular 5 and I covered some interesting tutorials like using [Angular Material, FlexLayout], building [PWA, dynamic themes] and deploying our angular app to Netlify You can check the&lt;a href="https://medium.com/@geeksamu/angular-5-article-series-a614d38b12ad" rel="noopener noreferrer"&gt;series here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But for this series:&lt;br&gt;&lt;br&gt;
Angular Team just announced Angular 6 and the new amazing features, so I can't wait to build amazing things using Angular 6.&lt;/p&gt;

&lt;p&gt;In the previous series, I made it “Seven-Part” series with 7 articles for every part.&lt;br&gt;&lt;br&gt;
But I want to make this series n-part Series. I don’t want to stop this series. I want to add more articles later, so If you’re interested in Angular. You can check this series later for more updates.&lt;/p&gt;

&lt;p&gt;The reason why I created this series of articles is that it’s the series I wish I had when I was first learning Angular. I know that there's a lot of tutorials out there that explain every part of my series alone. But the problem is gathering all these tutorials together sometimes gives conflicts and errors, so I wanted to save my own time and your time also to avoid all these problems.&lt;br&gt;&lt;br&gt;
Each part in this series is not intended to be a complete guide, but rather an overview of the basics to get you up and running so you can get to know how to collect things together and understand what the framework has to offer.&lt;/p&gt;
&lt;h3&gt;
  
  
  Article Series
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Angular 6 Article Series ( &lt;strong&gt;You’re here&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/building-angular-6-application-4bd7b19a66ab" rel="noopener noreferrer"&gt;Building Angular 6 Application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-6-862a1c3d04b" rel="noopener noreferrer"&gt;Using Angular Material with Angular 6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/deploy-angular-6-application-to-netlify-60b39b9df61c" rel="noopener noreferrer"&gt;Deploy Angular 6 Application to Netlify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Creating PWA with Angular 6 ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Dynamic themes in Angular 6 Material ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Angular 6 with GSAP ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;Angular 6 with Firebase ( &lt;strong&gt;Soon&lt;/strong&gt; )&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  New Features of Angular 6
&lt;/h3&gt;

&lt;p&gt;Angular 6 was just released with new amazing features and a lot of changes.&lt;/p&gt;
&lt;h3&gt;
  
  
  ng update
&lt;/h3&gt;

&lt;p&gt;Running ng update &amp;lt;package&amp;gt; the CLI will analyze your package.json and update your packages. Updating an Angular application is just a command away.&lt;/p&gt;
&lt;h3&gt;
  
  
  ng add
&lt;/h3&gt;

&lt;p&gt;It’s the same as ng update but it allows you to add and configure libraries.&lt;br&gt;&lt;br&gt;
For example if you want to install Angular Material you have to run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng add @angular/material
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Other Changes
&lt;/h3&gt;

&lt;p&gt;.angular-cli.json now renamed to angular.json with a new structure&lt;br&gt;&lt;br&gt;
You can check the other changes here in the &lt;a href="https://blog.angular.io/version-6-of-angular-now-available-cc56b0efa7a4" rel="noopener noreferrer"&gt;official announcement&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Upgrading
&lt;/h3&gt;

&lt;p&gt;Angular Team created a great tool to upgrade you old angular app&lt;br&gt;&lt;br&gt;
&lt;a href="https://update.angular.io/" rel="noopener noreferrer"&gt;Angular Update Guide&lt;/a&gt;. use it to migrate your angular apps.&lt;br&gt;&lt;br&gt;
Once you choose your current app version and the complexity of your app. It’ll show you the steps you need to upgrade your app.&lt;br&gt;&lt;br&gt;
I won’t repeat their steps just follow them and watch the step that named Before updating as it must be made correctly.&lt;br&gt;&lt;br&gt;
That's all for now.&lt;/p&gt;

&lt;p&gt;Next: &lt;a href="https://blog.wb.gy/p/57c1772f-2e65-4cf8-a6ad-9059184ed466/" rel="noopener noreferrer"&gt;Building Angular 6 Application&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  If you liked this article, hit that clap button below 👏. check out other articles I’ve written &lt;a href="https://blog.wb.gy" rel="noopener noreferrer"&gt;here&lt;/a&gt;. And If you find this story useful. As I don’t use Medium Partner Program. Consider a donation through &lt;a href="http://paypal.me/geeksamu" rel="noopener noreferrer"&gt;PayPal&lt;/a&gt;, or &lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;‘Buy Me a Coffee’&lt;/a&gt; :)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;Buy Ahmed Abdelsalam a Coffee. ko-fi.com/geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any question comment it below or You can find me on Twitter &lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;@geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;Ahmed ⚯͛ (@geeksamu) | Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>javascript</category>
      <category>angular6</category>
      <category>angular2</category>
    </item>
    <item>
      <title>Building News App using Angular 5</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Tue, 01 May 2018 14:53:13 +0000</pubDate>
      <link>https://dev.to/geeksamu/building-news-app-using-angular-5-32a7</link>
      <guid>https://dev.to/geeksamu/building-news-app-using-angular-5-32a7</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A5cKcOlpn-496sxVvqcognw.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A5cKcOlpn-496sxVvqcognw.jpeg"&gt;&lt;/a&gt;Angular5 , news app ( image source topal)&lt;/p&gt;

&lt;p&gt;This is the seventh part in a seven-part &lt;a href="https://blog.wb.gy/angular-5-article-series/" rel="noopener noreferrer"&gt;series&lt;/a&gt; about the JavaScript framework, Angular 5.&lt;br&gt;&lt;br&gt;
In this part, we'll go over turning our application into a News Application.&lt;/p&gt;

&lt;p&gt;This is not intended to be a complete guide, but rather an overview of the basics to get you up and running so you can get to know using Angular Services and how to turn your Angular 5 application into a News app.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Before we begin, English is not my first language, so if you see something weird, please, calmly point it out in the comment section or email me, there’s no need for violence :)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Article Series:&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/creating-angular-5-application-with-angular-cli-e390ed710716" rel="noopener noreferrer"&gt;Creating Angular 5 application with Angular-cli&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-5-6f12f75efa12" rel="noopener noreferrer"&gt;Using&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-5-6f12f75efa12" rel="noopener noreferrer"&gt;Angular Material with&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-5-6f12f75efa12" rel="noopener noreferrer"&gt;Angular 5&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/deploy-angular-5-application-to-netlify-35b8964bce99" rel="noopener noreferrer"&gt;Deploy Angular 5 Application to Netlify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@geeksamu/build-pwa-with-angular-5-app-894499e2c55f" rel="noopener noreferrer"&gt;Build&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/build-pwa-with-angular-5-app-894499e2c55f" rel="noopener noreferrer"&gt;PWA with Angular 5 App&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@geeksamu/build-dynamic-themes-for-angular-material-3b4ef118ba31" rel="noopener noreferrer"&gt;Build Dynamic themes for&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/build-dynamic-themes-for-angular-material-3b4ef118ba31" rel="noopener noreferrer"&gt;Angular Material&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/geeksamu/using-flexlayout-with-angular-5-5789-temp-slug-1685366"&gt;Using&lt;/a&gt;&lt;a href="https://dev.to/geeksamu/using-flexlayout-with-angular-5-5789-temp-slug-1685366"&gt;FlexLayout with Angular 5&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Building News App using Angular 5(&lt;strong&gt;You are here)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Final&lt;/em&gt; &lt;a href="https://angular-5-article-series.netlify.com/" rel="noopener noreferrer"&gt;&lt;em&gt;Demo here&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I’m going to turn the application We created in the 6 previous articles, so you have to check them first!&lt;br&gt;&lt;br&gt;
No, you must check all of them!&lt;/p&gt;

&lt;p&gt;Our News app will be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a Progressive web application (PWA)&lt;/li&gt;
&lt;li&gt;With Angular Material Design&lt;/li&gt;
&lt;li&gt;with a grid-system using Flex-Layout&lt;/li&gt;
&lt;li&gt;Deployed to Netlify&lt;/li&gt;
&lt;li&gt;With 2 dynamic themes&lt;/li&gt;
&lt;li&gt;Later we can improve it with more option you can suggest or ask me what you want in the next article&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Build News Service
&lt;/h3&gt;

&lt;p&gt;In the previous articles We created a component named posts. I'll use it to show our news posts.&lt;/p&gt;

&lt;p&gt;First Let’s discuss the layout of our posts component.&lt;br&gt;&lt;br&gt;
I want to build two things: part for filtering the news and part for displaying the news itself&lt;/p&gt;

&lt;p&gt;I’ll use newsapi.org's api to get the news, so you have to signup and get a key.&lt;/p&gt;

&lt;p&gt;Next, we have to create new angular service to get the news from the API. I'll name it news service.&lt;br&gt;&lt;br&gt;
Now, in your application's root directory open your terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng g service services/news --module app.module.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will create our news service and will update our app.module.ts.&lt;/p&gt;

&lt;p&gt;We need to add something first in our app.module.ts to use it in new.service.ts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { HttpModule } from '@angular/http';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add it to the imports&lt;br&gt;&lt;br&gt;
Now your app.module.ts should look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialModule } from './material.module';
import { FlexLayoutModule } from '@angular/flex-layout';
import { HttpModule } from '@angular/http'; 
import { AppRoutingModule } from './app-routing.module';
import { FormsModule,ReactiveFormsModule } from '@angular/forms';

import { ServiceWorkerModule } from '@angular/service-worker';
import { AppComponent } from './app.component';

import { environment } from '../environments/environment';
import { PostsComponent } from './posts/posts.component';
import { HomeComponent } from './home/home.component';
import { NavbarComponent } from './navbar/navbar.component';
import { ThemeService } from './services/theme.service';
import { NewsService } from './services/news.service';

@NgModule({
 declarations: [
 AppComponent,
 PostsComponent,
 HomeComponent,
 NavbarComponent
 ],
 imports: [
 BrowserModule,
 BrowserAnimationsModule,
 MaterialModule,
 FlexLayoutModule,
 AppRoutingModule,
 FormsModule,
 ReactiveFormsModule,
 HttpModule,
 ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
 ],
 providers: [ThemeService, NewsService],
 bootstrap: [AppComponent]
})
export class AppModule { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First Let’s explain what we’re going to do, I know that this part is so boring but you have to know it, so you can handle things later yourself.&lt;br&gt;&lt;br&gt;
Next you have to replace your-key-here with your API key you got from your account here &amp;gt; &lt;a href="https://newsapi.org/account" rel="noopener noreferrer"&gt;https://newsapi.org/account&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Details of News Service
&lt;/h3&gt;

&lt;p&gt;Next we need to build the functions to call the api from our news.service&lt;/p&gt;

&lt;p&gt;We’ll build 3 functions getTopHeadLines(), getNewBySource() and getSources().&lt;br&gt;&lt;br&gt;
getTopHeadLines: will get the Top Headlines news. and this will be displayed as the default news.&lt;br&gt;&lt;br&gt;
getSources: it will give us all the news sources, we'll use them to filter our news.&lt;br&gt;&lt;br&gt;
getNewBySource: We'll use the previous function to get the sources to use it in this function.&lt;/p&gt;

&lt;p&gt;Here’s the code of our service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions } from '@angular/http';
import { environment } from '../../environments/environment';

@Injectable()
export class NewsService {
 key = 'your-key-here';
 constructor(private http: Http) { }
 getTopHeadLines(){
 return this.http.get('[https://newsapi.org/v2/top-headlines?country=us&amp;amp;category=business&amp;amp;apiKey=](https://newsapi.org/v2/top-headlines?country=us&amp;amp;category=business&amp;amp;apiKey=)'+this.key);
 }
 getNewBySource(source){
 return this.http.get('[https://newsapi.org/v2/top-headlines?sources=](https://newsapi.org/v2/top-headlines?sources=)'+source+'&amp;amp;apiKey='+this.key);
 }
 getSources(){
 return this.http.get('[https://newsapi.org/v2/sources?apiKey=](https://newsapi.org/v2/sources?apiKey=)'+this.key);
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Adding `News Service to posts.component.ts
&lt;/h3&gt;

&lt;p&gt;Now we need to edit our posts.component.ts. As we created 3 functions in our servicewe'll use them here in posts.component.ts&lt;/p&gt;

&lt;h3&gt;
  
  
  First
&lt;/h3&gt;

&lt;p&gt;you have to import new.service.ts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Second
&lt;/h3&gt;

&lt;p&gt;create 2 variable:&lt;br&gt;&lt;br&gt;
1st: will be news= {articles:[]}&lt;br&gt;&lt;br&gt;
2nd: will be newsSources= {sources:[]}&lt;/p&gt;

&lt;h3&gt;
  
  
  Third
&lt;/h3&gt;

&lt;p&gt;I’ll display articles from getTopHeadLines in ngOnInit and the new resources also.&lt;/p&gt;

&lt;p&gt;Here’s the code of our src/posts/posts.component.ts&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
import { Component, OnInit } from "@angular/core";&lt;br&gt;
import { NewsService } from '../services/news.service';&lt;/p&gt;

&lt;p&gt;@Component({&lt;br&gt;
 selector: "app-posts",&lt;br&gt;
 templateUrl: "./posts.component.html",&lt;br&gt;
 styleUrls: ["./posts.component.scss"],&lt;br&gt;
 providers:[NewsService]&lt;br&gt;
})&lt;br&gt;
export class PostsComponent implements OnInit {&lt;br&gt;
 news= {articles:[]};&lt;br&gt;
 newsSources= {sources:[]};&lt;br&gt;
 filterSource='google-news';&lt;/p&gt;

&lt;p&gt;constructor(private newsService: NewsService){}&lt;/p&gt;

&lt;p&gt;ngOnInit() {&lt;br&gt;
 this.newsService.getTopHeadLines()&lt;br&gt;
 .subscribe(&lt;br&gt;
 response =&amp;gt; this.news = response.json()&lt;br&gt;
 );&lt;br&gt;
 this.getnewsSources();&lt;br&gt;
 }&lt;/p&gt;

&lt;p&gt;filterNews(source) {&lt;br&gt;
 this.news={articles:[]};&lt;br&gt;
 this.newsService.getNewBySource(source)&lt;br&gt;
 .subscribe(&lt;br&gt;
 response =&amp;gt; this.news = response.json()&lt;br&gt;
 );&lt;br&gt;
 }&lt;/p&gt;

&lt;p&gt;getnewsSources() {&lt;br&gt;
 this.newsService.getSources()&lt;br&gt;
 .subscribe(&lt;br&gt;
 response =&amp;gt; this.newsSources = response.json()&lt;br&gt;
 );&lt;br&gt;
 } &lt;br&gt;
}&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For the view of this component in posts.component.html&lt;br&gt;&lt;br&gt;
I made 2 parts as I said at the beginning of this article:&lt;br&gt;&lt;br&gt;
one for filtering the news and one to show them. I used Flex-Layout also.&lt;br&gt;&lt;br&gt;
I added two things for the posts:&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix damaged images
&lt;/h3&gt;

&lt;p&gt;You might noticed that there are some images that does not load correctly, to solve this problem I added this attribute onError="this.src='/assets/blank.png';"&lt;br&gt;&lt;br&gt;
It will display default image for damaged images.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spinner loader
&lt;/h3&gt;

&lt;p&gt;Also I added a spinner to been displayed while our application fetching the data from the api, I used the Angular Material module MatSpinnerModule.&lt;/p&gt;

&lt;p&gt;Here’s the code of posts.component.html&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
&amp;lt;div class="container margin-top" fxLayout="wrap row" fxLayout.xs="column" fxLayoutGap="1%" fxLayoutAlign="center"&amp;gt;&lt;br&gt;
 &amp;lt;mat-card class="filter"&amp;gt;&lt;br&gt;
 &amp;lt;form #filternewsForm="ngForm"&amp;gt;&lt;br&gt;
 &amp;lt;mat-form-field&amp;gt;&lt;br&gt;
 &amp;lt;mat-select placeholder="News Source" [(ngModel)]='filterSource' name="source" required&amp;gt;&lt;br&gt;
 &amp;lt;mat-option *ngFor="let source of newsSources.sources" [value]="source.id"&amp;gt;&lt;br&gt;
 {{source.name}} - {{ source.language }}&lt;br&gt;
 &amp;lt;/mat-option&amp;gt;&lt;br&gt;
 &amp;lt;/mat-select&amp;gt;&lt;br&gt;
 &amp;lt;/mat-form-field&amp;gt;&lt;br&gt;
 &amp;lt;button mat-raised-button color="primary" (click)='filterNews(filterSource)' [disabled]="!filternewsForm.form.valid"&amp;gt;Filter News to&lt;br&gt;
 &amp;lt;span style="text-transform: capitalize; "&amp;gt;{{filterSource}}&amp;lt;/span&amp;gt;&lt;br&gt;
 &amp;lt;/button&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/form&amp;gt;&lt;br&gt;
 &amp;lt;/mat-card&amp;gt;&lt;br&gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;div class="loader" *ngIf="!((news.articles)?.length &amp;gt; 0)"&amp;gt;&lt;br&gt;
 &amp;lt;mat-spinner&amp;gt;&amp;lt;/mat-spinner&amp;gt;&lt;br&gt;
 &amp;lt;/div&amp;gt;&lt;br&gt;
&amp;lt;div class="container" fxLayout="wrap row" fxLayout.xs="column" fxLayoutGap="1%" fxLayoutAlign="center"&amp;gt;&lt;br&gt;
 &amp;lt;div *ngFor="let post of news.articles" fxFlex="20%"&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;mat-card class=singleNews&amp;gt;&lt;br&gt;
 &amp;lt;img mat-card-image src="{{post.urlToImage}}" onError="this.src='/assets/blank.png';"&amp;gt;&lt;br&gt;
 &amp;lt;div class="cardbody"&amp;gt;&lt;br&gt;
 &amp;lt;mat-card-title&amp;gt;{{post.title}}&amp;lt;/mat-card-title&amp;gt;&lt;br&gt;
 &amp;lt;mat-card-content&amp;gt;&lt;br&gt;
 &amp;lt;p&amp;gt;{{post.description}}&amp;lt;/p&amp;gt;&lt;br&gt;
 &amp;lt;/mat-card-content&amp;gt;&lt;br&gt;
 &amp;lt;/div&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;mat-card-actions align="end"&amp;gt;&lt;br&gt;
 &amp;lt;a href="{{post.url}}" target="_balnk" mat-raised-button color="accent"&amp;gt;Read More&amp;lt;/a&amp;gt;&lt;br&gt;
 &amp;lt;/mat-card-actions&amp;gt;&lt;br&gt;
 &amp;lt;/mat-card&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/div&amp;gt;&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I did some small styling in src/app/posts/posts.component.scss&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
.singleNews {&lt;br&gt;
 margin-bottom: 15px;&lt;br&gt;
 img {&lt;br&gt;
 height: 200px;&lt;br&gt;
 }&lt;br&gt;
 mat-card-title {&lt;br&gt;
 font-size: 16px;&lt;br&gt;
 font-weight: bold;&lt;br&gt;
 }&lt;br&gt;
 .cardbody {&lt;br&gt;
 height: 100px;&lt;br&gt;
 overflow-y: auto;&lt;br&gt;
 margin: 0 -15px;&lt;br&gt;
 padding: 10px;&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
.filter {&lt;br&gt;
 margin-top: 100px;&lt;br&gt;
 margin-bottom: 50px;&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and I added some styling for the loader in src/styles.scss&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
@import "./assets/styles/material-theme";&lt;br&gt;
body {&lt;br&gt;
 margin: 0;&lt;br&gt;
}&lt;br&gt;
.loader mat-spinner {&lt;br&gt;
 margin: 10px auto;&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Change homepage content to Top News
&lt;/h3&gt;

&lt;p&gt;For our home screen I want to make it dynamic, so let’s display our Top Hot-lines there.&lt;br&gt;&lt;br&gt;
We’ll use the same code and service:&lt;br&gt;&lt;br&gt;
Open src/app/home/home.component.html&lt;br&gt;&lt;br&gt;
and add the following code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
&amp;lt;div class="homebtn" fxLayout="wrap row" fxLayout.xs="column" fxLayoutGap="1%" fxLayoutAlign="center"&amp;gt;&lt;br&gt;
 &amp;lt;a routerLink="/posts" mat-raised-button color="primary"&amp;gt;Choose News Source&amp;lt;/a&amp;gt;&lt;br&gt;
&amp;lt;/div&amp;gt;&lt;br&gt;
&amp;lt;div class="loader" *ngIf="!((news.articles)?.length &amp;gt; 0)"&amp;gt;&lt;br&gt;
 &amp;lt;mat-spinner&amp;gt;&amp;lt;/mat-spinner&amp;gt;&lt;br&gt;
&amp;lt;/div&amp;gt;&lt;br&gt;
&amp;lt;div class="container" fxLayout="wrap row" fxLayout.xs="column" fxLayoutGap="1%" fxLayoutAlign="center"&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;div *ngFor="let post of news.articles" fxFlex="20%"&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;mat-card class=singleNews&amp;gt;&lt;br&gt;
 &amp;lt;img mat-card-image src="{{post.urlToImage}}" onError="this.src='/assets/blank.png';"&amp;gt;&lt;br&gt;
 &amp;lt;div class="cardbody"&amp;gt;&lt;br&gt;
 &amp;lt;mat-card-title&amp;gt;{{post.title}}&amp;lt;/mat-card-title&amp;gt;&lt;br&gt;
 &amp;lt;mat-card-content&amp;gt;&lt;br&gt;
 &amp;lt;p&amp;gt;{{post.description}}&amp;lt;/p&amp;gt;&lt;br&gt;
 &amp;lt;/mat-card-content&amp;gt;&lt;br&gt;
 &amp;lt;/div&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;mat-card-actions align="end"&amp;gt;&lt;br&gt;
 &amp;lt;a href="{{post.url}}" target="_balnk" mat-raised-button color="accent"&amp;gt;Read More&amp;lt;/a&amp;gt;&lt;br&gt;
 &amp;lt;/mat-card-actions&amp;gt;&lt;br&gt;
 &amp;lt;/mat-card&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/div&amp;gt;&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And replace the code into src/app/home/home.component.ts with&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
import { Component, OnInit } from '@angular/core';&lt;br&gt;
import { NewsService } from '../services/news.service';&lt;/p&gt;

&lt;p&gt;@Component({&lt;br&gt;
 selector: 'app-home',&lt;br&gt;
 templateUrl: './home.component.html',&lt;br&gt;
 styleUrls: ['./home.component.scss'],&lt;br&gt;
 providers:[NewsService]&lt;/p&gt;

&lt;p&gt;})&lt;br&gt;
export class HomeComponent implements OnInit {&lt;br&gt;
 news= {articles:[]};&lt;/p&gt;

&lt;p&gt;constructor(private newsService: NewsService){}&lt;/p&gt;

&lt;p&gt;ngOnInit() {&lt;br&gt;
 this.newsService.getTopHeadLines()&lt;br&gt;
 .subscribe(&lt;br&gt;
 response =&amp;gt; this.news = response.json()&lt;br&gt;
 );&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally let’s add some styling open src/app/home/home.component.scss&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
.singleNews {&lt;br&gt;
 margin-bottom: 15px;&lt;br&gt;
 img {&lt;br&gt;
 height: 200px;&lt;br&gt;
 }&lt;br&gt;
 mat-card-title {&lt;br&gt;
 font-size: 16px;&lt;br&gt;
 font-weight: bold;&lt;br&gt;
 }&lt;br&gt;
 .cardbody {&lt;br&gt;
 height: 100px;&lt;br&gt;
 overflow-y: auto;&lt;br&gt;
 margin: 0 -15px;&lt;br&gt;
 padding: 10px;&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
.homebtn{&lt;br&gt;
 margin:40px 0;&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now our application is done! Here’s the final result&lt;/p&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AhmzCWKOutB-8P1PI.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AhmzCWKOutB-8P1PI.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And you can find the &lt;a href="https://angular-5-article-series.netlify.com/" rel="noopener noreferrer"&gt;demo here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  If you liked this article, hit that clap button below 👏. check out other articles I’ve written &lt;a href="https://blog.wb.gy" rel="noopener noreferrer"&gt;here&lt;/a&gt;. And If you find this story useful. As I don’t use Medium Partner Program. Consider a donation through &lt;a href="http://paypal.me/geeksamu" rel="noopener noreferrer"&gt;PayPal&lt;/a&gt;, or &lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;‘Buy Me a Coffee’&lt;/a&gt; :)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;Buy Ahmed Abdelsalam a Coffee. ko-fi.com/geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any question comment it below or You can find me on Twitter &lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;@geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;Ahmed ⚯͛ (@geeksamu) | Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular5</category>
      <category>javascript</category>
      <category>angular</category>
      <category>angular4</category>
    </item>
    <item>
      <title>Using FlexLayout with Angular 5</title>
      <dc:creator>Ahmed Abdelsalam</dc:creator>
      <pubDate>Tue, 01 May 2018 14:53:08 +0000</pubDate>
      <link>https://dev.to/geeksamu/using-flexlayout-with-angular-5-3i5l</link>
      <guid>https://dev.to/geeksamu/using-flexlayout-with-angular-5-3i5l</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ADNGtiMt4J3LVnejn5gJ2Fw.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ADNGtiMt4J3LVnejn5gJ2Fw.jpeg"&gt;&lt;/a&gt;Angular5 , flexlayout ( image source topal)&lt;/p&gt;

&lt;p&gt;This is the sixth part in a seven-part &lt;a href="https://blog.wb.gy/angular-5-article-series/" rel="noopener noreferrer"&gt;series&lt;/a&gt; about the JavaScript framework, Angular 5.&lt;br&gt;&lt;br&gt;
In this part, we'll go over adding Flex-Layout to our application to make it responsive.&lt;/p&gt;

&lt;p&gt;This is not intended to be a complete guide, but rather an overview of the basics to get you up and running so you can get to know Flext-Layout and how to use it with Angular 5 Material.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Before we begin, English is not my first language, so if you see something weird, please, calmly point it out in the comment section or email me, there’s no need for violence :)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Article Series:&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/creating-angular-5-application-with-angular-cli-e390ed710716" rel="noopener noreferrer"&gt;Creating Angular 5 application with Angular-cli&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-5-6f12f75efa12" rel="noopener noreferrer"&gt;Using&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-5-6f12f75efa12" rel="noopener noreferrer"&gt;Angular Material with&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/using-angular-material-with-angular-5-6f12f75efa12" rel="noopener noreferrer"&gt;Angular 5&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@geeksamu/deploy-angular-5-application-to-netlify-35b8964bce99" rel="noopener noreferrer"&gt;Deploy Angular 5 Application to Netlify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@geeksamu/build-pwa-with-angular-5-app-894499e2c55f" rel="noopener noreferrer"&gt;Build&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/build-pwa-with-angular-5-app-894499e2c55f" rel="noopener noreferrer"&gt;PWA with Angular 5 App&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@geeksamu/build-dynamic-themes-for-angular-material-3b4ef118ba31" rel="noopener noreferrer"&gt;Build Dynamic themes for&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/build-dynamic-themes-for-angular-material-3b4ef118ba31" rel="noopener noreferrer"&gt;Angular Material&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Using FlexLayout with Angular 5 (&lt;strong&gt;You are here)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@geeksamu/building-news-app-using-angular-5-99a9e5fb4669" rel="noopener noreferrer"&gt;Building&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/building-news-app-using-angular-5-99a9e5fb4669" rel="noopener noreferrer"&gt;News App using&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/building-news-app-using-angular-5-99a9e5fb4669" rel="noopener noreferrer"&gt;Angular 5&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Final&lt;/em&gt; &lt;a href="https://angular-5-article-series.netlify.com/" rel="noopener noreferrer"&gt;&lt;em&gt;Demo here&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you want to add a touch styling to your Angular application you have to use one of the CSS Libraries, but Angular Material is specially designed for Angular. But it does not have a grid system, so we need to add one or build it ourself.&lt;/p&gt;

&lt;p&gt;In the Angular Material article I created a simple grid using flex, but you can use Flex-Layout for more complex uses.&lt;br&gt;&lt;br&gt;
Some people won't like Flex-Layout and would prefer using css flex. It's up to you.&lt;br&gt;&lt;br&gt;
But in this article I'll talk about how to use Flex-Layout with Angular Material and we'll turn our previous posts into grid using Flex-Layout.&lt;/p&gt;

&lt;p&gt;In our application root run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @angular/flex-layout@latest --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have to import FlexLayoutModule into our app.module.ts&lt;br&gt;&lt;br&gt;
Here's my app.module.ts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialModule } from './material.module';
import { FlexLayoutModule } from '@angular/flex-layout';

import { AppRoutingModule } from './app-routing.module';

import { ServiceWorkerModule } from '@angular/service-worker';
import { AppComponent } from './app.component';

import { environment } from '../environments/environment';
import { PostsComponent } from './posts/posts.component';
import { HomeComponent } from './home/home.component';
import { NavbarComponent } from './navbar/navbar.component';
import { ThemeService } from './services/theme.service';

@NgModule({
 declarations: [
 AppComponent,
 PostsComponent,
 HomeComponent,
 NavbarComponent
 ],
 imports: [
 BrowserModule,
 BrowserAnimationsModule,
 MaterialModule,
 FlexLayoutModule,
 AppRoutingModule,
 ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
 ],
 providers: [ThemeService],
 bootstrap: [AppComponent]
})
export class AppModule { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s use Flex-Layout with our home posts.&lt;br&gt;&lt;br&gt;
I'll use the next code to create our grid&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\&amp;lt;div class="container" fxLayout="wrap row" fxLayout.xs="column" fxLayoutGap="0.5%" fxLayoutAlign="center"\&amp;gt;
 \&amp;lt;div fxFlex="20%"\&amp;gt;
 \&amp;lt;!-- our post code here --\&amp;gt;
 \&amp;lt;/div\&amp;gt;
\&amp;lt;/div\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create 4 posts in one row I’ll make fxFlex= 20%. and put your post code instead of the comment, and repeat this part as you want.&lt;br&gt;&lt;br&gt;
Open src/app/home/home.component.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\&amp;lt;div class="container" fxLayout="wrap row" fxLayout.xs="column" fxLayoutGap="1%" fxLayoutAlign="center"\&amp;gt;
 \&amp;lt;div fxFlex="20%"\&amp;gt;
 \&amp;lt;mat-card class="example-card"\&amp;gt;
 \&amp;lt;mat-card-header\&amp;gt;
 \&amp;lt;div mat-card-avatar class="example-header-image"\&amp;gt;\&amp;lt;/div\&amp;gt;
 \&amp;lt;mat-card-title\&amp;gt;Shiba Inu\&amp;lt;/mat-card-title\&amp;gt;
 \&amp;lt;mat-card-subtitle\&amp;gt;Dog Breed\&amp;lt;/mat-card-subtitle\&amp;gt;
 \&amp;lt;/mat-card-header\&amp;gt;
 \&amp;lt;img mat-card-image src="/assets/shiba2.jpeg" alt="Photo of a Shiba Inu"\&amp;gt;
 \&amp;lt;mat-card-content\&amp;gt;
 \&amp;lt;p\&amp;gt;
 The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan. A small, agile dog that copes
 very well with mountainous terrain, the Shiba Inu was originally bred for hunting.
 \&amp;lt;/p\&amp;gt;
 \&amp;lt;/mat-card-content\&amp;gt;
 \&amp;lt;mat-card-actions\&amp;gt;
 \&amp;lt;button mat-button\&amp;gt;LIKE\&amp;lt;/button\&amp;gt;
 \&amp;lt;button mat-button\&amp;gt;SHARE\&amp;lt;/button\&amp;gt;
 \&amp;lt;/mat-card-actions\&amp;gt;
 \&amp;lt;/mat-card\&amp;gt;
 \&amp;lt;/div\&amp;gt;
\&amp;lt;/div\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the flex-layout &lt;a href="https://github.com/angular/flex-layout/wiki/API-Documentation#containers" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; for more complex uses.&lt;/p&gt;

&lt;p&gt;Now you can remove our css code in home.component.scss.&lt;/p&gt;

&lt;p&gt;Next: &lt;a href="https://medium.com/@geeksamu/building-news-app-using-angular-5-99a9e5fb4669" rel="noopener noreferrer"&gt;Building&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/building-news-app-using-angular-5-99a9e5fb4669" rel="noopener noreferrer"&gt;News App using&lt;/a&gt;&lt;a href="https://medium.com/@geeksamu/building-news-app-using-angular-5-99a9e5fb4669" rel="noopener noreferrer"&gt;Angular 5&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  If you liked this article, hit that clap button below 👏. check out other articles I’ve written &lt;a href="https://blog.wb.gy" rel="noopener noreferrer"&gt;here&lt;/a&gt;. And If you find this story useful. As I don’t use Medium Partner Program. Consider a donation through &lt;a href="http://paypal.me/geeksamu" rel="noopener noreferrer"&gt;PayPal&lt;/a&gt;, or &lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;‘Buy Me a Coffee’&lt;/a&gt; :)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://ko-fi.com/geeksamu" rel="noopener noreferrer"&gt;Buy Ahmed Abdelsalam a Coffee. ko-fi.com/geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any question comment it below or You can find me on Twitter &lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;@geeksamu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/geeksamu" rel="noopener noreferrer"&gt;Ahmed ⚯͛ (@geeksamu) | Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular2</category>
      <category>angular</category>
      <category>javascript</category>
      <category>angular5</category>
    </item>
  </channel>
</rss>
