<?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: Nathan Pickard</title>
    <description>The latest articles on DEV Community by Nathan Pickard (@nathanpickard).</description>
    <link>https://dev.to/nathanpickard</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%2F236722%2F94a3d6b7-5333-452f-943b-02ec86bba572.jpg</url>
      <title>DEV Community: Nathan Pickard</title>
      <link>https://dev.to/nathanpickard</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nathanpickard"/>
    <language>en</language>
    <item>
      <title>Quick Release Creator - GitHub Action</title>
      <dc:creator>Nathan Pickard</dc:creator>
      <pubDate>Fri, 18 Sep 2020 05:04:59 +0000</pubDate>
      <link>https://dev.to/nathanpickard/quick-release-creator-github-action-1c08</link>
      <guid>https://dev.to/nathanpickard/quick-release-creator-github-action-1c08</guid>
      <description>&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Quick Release Creator&lt;/strong&gt; is a Github Action that lets you quickly create new releases for your github repos through a manually triggered workflow_dispatch event!&lt;/p&gt;

&lt;p&gt;Instead of drafting a new release from scratch under the "Releases" section of a repo, Quick Release Creator provides you with a form to fill out which neatly composes a release for you.  No need to remember what exactly to include in a release or fumbling with markdown!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ukr56rs2c9pjx3ys9ow.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ukr56rs2c9pjx3ys9ow.png" alt="action-screenshot" width="710" height="978"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can provide specific information about your release to the action, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The version number tag&lt;/li&gt;
&lt;li&gt;The name/title of the release&lt;/li&gt;
&lt;li&gt;A brief description of major and minor changes&lt;/li&gt;
&lt;li&gt;Any additional notes about the release&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;The major/minor changes and notes fields default to (Not noted) if that information is not provided)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After hitting the green "Run workflow" button, the action will execute and create your new release from the information you provided!&lt;/p&gt;

&lt;p&gt;Quick Release Creator will then output a clean looking release with the help of some simple markdown!  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Voilà!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Release example:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuyx0zllrg3z6z6gx03iy.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuyx0zllrg3z6z6gx03iy.png" alt="release-screenshot" width="800" height="920"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Maintainer Must-Haves&lt;/li&gt;
&lt;li&gt;DIY Deployments&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Yaml File:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Quick Release workflow

on:
  workflow_dispatch:
    inputs:
      version-number:
        description: 'Version number tag:'
        default: 'Enter version number'
        required: true
      release-name:
        description: 'Release name:'
        default: 'Enter release name'
        required: true
      major-changes:
        description: 'Major changes:'
        default: '(No major changes noted)'
        required: false
      minor-changes:
        description: 'Minor changes:'
        default: '(No minor changes noted)'
        required: false
      notes:
        description: 'Notes:'
        default: '(No extra notes)'
        required: false

jobs:  
  build:
    name: Create Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: v${{ github.event.inputs.version-number }}
          release_name: ${{ github.event.inputs.release-name }}
          body: |
            ## Major changes:
            ${{ github.event.inputs.major-changes }}

            ## Minor changes:
            ${{ github.event.inputs.minor-changes }}

            ## Notes: 
            ${{ github.event.inputs.notes }}
          draft: false
          prerelease: false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;Quick Release Creator is based off the &lt;a href="https://github.com/marketplace/actions/create-a-release#example-workflow---create-a-release" rel="noopener noreferrer"&gt;Create a Release&lt;/a&gt; GitHub action&lt;/p&gt;

&lt;p&gt;I'm currently using my custom GitHub action in my &lt;a href="https://github.com/NathanPickard/Live-Music-PDX" rel="noopener noreferrer"&gt;&lt;strong&gt;Live Music PDX&lt;/strong&gt;&lt;/a&gt; application, the live music finder for Portland, Oregon!&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NathanPickard" rel="noopener noreferrer"&gt;
        NathanPickard
      &lt;/a&gt; / &lt;a href="https://github.com/NathanPickard/Live-Music-PDX" rel="noopener noreferrer"&gt;
        Live-Music-PDX
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Live music finder for the Portland, OR metro area
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Check it out the production version &lt;a href="https://d3hwbrrzu33taq.cloudfront.net/" rel="noopener noreferrer"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy coding!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>actionshackathon</category>
      <category>opensource</category>
      <category>github</category>
      <category>workflow</category>
    </item>
    <item>
      <title>Let’s use Angular Console!</title>
      <dc:creator>Nathan Pickard</dc:creator>
      <pubDate>Fri, 27 Sep 2019 16:59:43 +0000</pubDate>
      <link>https://dev.to/nathanpickard/let-s-use-angular-console-4nof</link>
      <guid>https://dev.to/nathanpickard/let-s-use-angular-console-4nof</guid>
      <description>&lt;p&gt;The first steps in starting to build a new web app often involve recalling a handful of commands.  Each project has it’s own unique set of components, features, and build tools. So to get your next app idea off the ground, you have to be able to find out exactly which set of terminal or CLI (command line interface) commands to execute.&lt;/p&gt;

&lt;p&gt;As developers, it always pays to figure out which apps and tools work best for us to be the most productive.  With constant experimentation, &lt;a href="https://nathanpickard.wordpress.com/2018/06/26/how-to-improve-your-code-without-coding-part-2/" rel="noopener noreferrer"&gt;keeping up&lt;/a&gt; on the latest tech trends daily, and finding &lt;a href="https://nathanpickard.wordpress.com/2018/02/11/tools-of-the-trade-for-the-modern-web-developer/" rel="noopener noreferrer"&gt;the right tools&lt;/a&gt;, time is of the essence when trying to maximize productivity.  Constantly alt-tabbing through open programs or clicking through open windows can drag down overall productivity, so being mindful of your coding workspace can give you the edge you need to get all those great feature ideas completed.&lt;/p&gt;

&lt;p&gt;As long as I can remember, I’ve been a big fan of applications that have great UIs (user interface).  These well laid out apps are usually ones that you find yourself using on a daily basis to do your most meaningful work.  Whether getting your app off the ground or finally deploying to production, it pays to have thoughtfully laid out tools which helps make getting your goals accomplished and keeps projects on track.  Consequently, being able to easily navigate around an app or utility with an intuitive user interface makes getting tasks done quick and easy.&lt;/p&gt;

&lt;p&gt;Applications with great UIs are mostly used by way of the mouse.  Being able to click around and visually see how your input is processed by the app makes sense to most users.  Reaching for the mouse or touch pad is usually the first thing people do when getting work done at the computer and you could say it’s become second nature to use this method of input.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp3k2ozyyli8bv54x5dd1.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp3k2ozyyli8bv54x5dd1.jpeg" alt="Alt Text" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now wouldn’t it be handy to not be confined to the terminal and use the mouse to execute those commands to make your app a reality?&lt;/p&gt;

&lt;p&gt;Luckily there is an awesome utility that combines the power of the &lt;a href="https://cli.angular.io/" rel="noopener noreferrer"&gt;Angular CLI&lt;/a&gt; with a user interface that can help make constructing Angular-based apps a better experience for beginner and experienced developers alike. This app, developed by the awesome folks at &lt;a href="https://nrwl.io/" rel="noopener noreferrer"&gt;Narwal&lt;/a&gt;, is aptly (&lt;em&gt;oh yeah&lt;/em&gt;) named Angular Console.  Let’s dive in, see what &lt;a href="https://angularconsole.com/" rel="noopener noreferrer"&gt;Angular Console&lt;/a&gt; is capable of, and use it to make a fun little app!&lt;/p&gt;




&lt;h2&gt;
  
  
  A different angle on building Angular applications
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhyr2meembnu3hmybzwid.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhyr2meembnu3hmybzwid.png" alt="Alt Text" width="256" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/nrwl/angular-console" rel="noopener noreferrer"&gt;Angular Console&lt;/a&gt; has made itself out to be the UI for the Angular CLI.  It combines the ability for developers to see visual representations of commands and tasks with the power of  the Angular CLI. &lt;br&gt;
 Angular Console does what the command-line version of the Angular CLI does, so that means anything you can do with the CLI, you can do with Angular Console.  Awesome!  And interesting…&lt;/p&gt;

&lt;p&gt;Originally, the Angular Console was built as a tool for expert developers, but the creators also aimed to make it a great option for those new to Angular or its CLI.  It’s provides the visual interface to create projects, run generators and commands, and install extensions all without ever touching the terminal.&lt;/p&gt;

&lt;p&gt;Trying to remember which commands to execute with the CLI can decrease your productivity, especially when you’re scaffolding your next great project idea.  Angular Console highlights the properties you are likely to use in development, so you don’t have to keep referring to the &lt;a href="https://angular.io/cli" rel="noopener noreferrer"&gt;CLI documentation&lt;/a&gt; to find the right task to implement.&lt;/p&gt;

&lt;p&gt;This 5 minute &lt;a href="https://youtu.be/d2K2Cp8BJx0" rel="noopener noreferrer"&gt;video overview&lt;/a&gt; from &lt;a href="https://twitter.com/fireship_dev" rel="noopener noreferrer"&gt;fireship.io&lt;/a&gt; quickly shows what Angular Console can do for you in your current and future projects.&lt;/p&gt;


&lt;h2&gt;
  
  
  Let's build!
&lt;/h2&gt;

&lt;p&gt;Now that we know what the Angular Console can do, let’s wield it’s power to create a fun and easy to build app.  We’re going to create a simple web app that displays a new Chuck Norris “fact” every time you press a “new fact” button.  After this tutorial, you’ll be developing Angular-based apps that are as powerful as a Chuck Norris roundhouse kick, so throw on your best pair of &lt;a href="https://farm5.static.flickr.com/4134/4768491342_14d53e28a9_o.jpg" rel="noopener noreferrer"&gt;kicking jeans&lt;/a&gt; and follow along with me!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxlw1y83j6cs5fs9o5vab.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxlw1y83j6cs5fs9o5vab.png" alt="Alt Text" width="336" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This tutorial is going to use the following tools that most web devs should have installed and ready to use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.google.com/chrome/" rel="noopener noreferrer"&gt;Chrome browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; (LTS version)&lt;/li&gt;
&lt;li&gt;And &lt;a href="https://angularconsole.com/" rel="noopener noreferrer"&gt;Angular Console&lt;/a&gt; of course!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We'll be using the &lt;a href="https://api.chucknorris.io/" rel="noopener noreferrer"&gt;Chuck Norris API&lt;/a&gt; to grab our data.&lt;/p&gt;

&lt;p&gt;While you’re free to use a different code editor or browser,  the tools listed above are exactly the ones I’m going to use here in this tutorial.  Let’s do it!&lt;/p&gt;


&lt;h3&gt;
  
  
  Laying the foundation
&lt;/h3&gt;

&lt;p&gt;Once you have Angular Console installed for your given OS, fire it up and click on the new app button to create a new project.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5x99frturz2tu6kpc59p.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5x99frturz2tu6kpc59p.png" alt="Alt Text" width="652" height="677"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next you’ll be presented with a window to create your new workspace for this project&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbk28jawk6ro1urbf0m9s.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbk28jawk6ro1urbf0m9s.png" alt="Alt Text" width="510" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go ahead and give a location where you’d like the project to live on your computer.  In my case, I’m putting this project on my desktop in a folder titled “Awesome Chuck Norris app”.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2pgqyuagu2yixk5jwy2.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2pgqyuagu2yixk5jwy2.png" alt="Alt Text" width="665" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next field, type in the name of the workspace or “project name”.  Let’s title it “chuck-norris-facts”.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0394mq0oxgss6do3ws7i.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0394mq0oxgss6do3ws7i.png" alt="Alt Text" width="778" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the third field, simply check the “@schematics/angular” checkbox.  This will set up a standard Angular project with the default settings.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fei6d2ioyme3eccw57fsx.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fei6d2ioyme3eccw57fsx.png" alt="Alt Text" width="756" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s the equivalent of executing the “ng new ‘whatever-app-name-here'” terminal command using the Angular CLI.&lt;/p&gt;

&lt;p&gt;Ignore the optional schematics field.  For the purposes of this app, we don’t need to delve into the &lt;a href="https://angular.io/cli/new" rel="noopener noreferrer"&gt;nitty gritty&lt;/a&gt; of all the options Angular Console/CLI provides when creating a new project.&lt;/p&gt;

&lt;p&gt;Hit “Create” and Angular Console will spin up a brand new project for us to sink our teeth into, all without typing a single terminal command!  AC simply does it for you.  Whoa!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcii0gzepndq11b39sp79.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcii0gzepndq11b39sp79.png" alt="Alt Text" width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The integrated terminal will take a minute or so to create a new angular project.&lt;/p&gt;

&lt;p&gt;Once the installation of our new app is ready, you’ll be presented with the “Projects” page where you can see all the projects you’ve loaded into Angular Console.  In our case, we have the new “chuck-norris-facts” app which is the main application.&lt;/p&gt;

&lt;p&gt;From here, go ahead and click on the “Open in…” drop-down menu in the upper right-hand corner and click on “VS Code”.  &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jftdc30z3i39xh04dnf.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jftdc30z3i39xh04dnf.PNG" alt="Alt Text" width="723" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will fire up VS Code for us with the newly minted “Chuck Norris Facts” app ready to be constructed.  Now let’s get to coding this thing!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg2826j0z1cz8yps1kk0m.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg2826j0z1cz8yps1kk0m.png" alt="Alt Text" width="792" height="481"&gt;&lt;/a&gt;&lt;/p&gt;
Voilá!  Here we have our freshly created app opened in VS Code!




&lt;h3&gt;
  
  
  Creating a component
&lt;/h3&gt;

&lt;p&gt;Angular applications are made up of components after all, so lets flip back to AC and click on the “generate” icon on the left-hand side and then click on the “component” option.&lt;/p&gt;

&lt;p&gt;Next, the generate component window will open which will execute the command for creating a new component.  Here, we see the required “name*” field, which will be the name for this particular component and the “project*” field, which is simply the name of the main application.  (While we won’t be using the “optional fields” sections, notice how AC provides additional configuration capabilities for our projects.)&lt;/p&gt;

&lt;p&gt;Go ahead and enter “chuck-norris-fact” and “chuck-norris-facts” respectfully in the name and project fields and then hit the “Generate” button in the top right.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyouuckkp0uzwpn5amq4.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyouuckkp0uzwpn5amq4.png" alt="Alt Text" width="746" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the process is complete, we can see the exact command the integrated terminal executed and the files it created within our project.  Pretty slick!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2l14xgii99pxgkikvsoc.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2l14xgii99pxgkikvsoc.png" alt="Alt Text" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Flip back over to VS Code and let’s see what AC created for us.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvok1ahffelmut6pxwuy1.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvok1ahffelmut6pxwuy1.PNG" alt="Alt Text" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we click through to “src” then “app” folders in our application, we see our new “chuck-norris-fact” component.  Sweet!  Let’s get to it and add our actually code to give this project some life.&lt;/p&gt;

&lt;p&gt;By default, the generate component command creates four individual files inside our components folder:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Typescript file that will hold the business logic of the component&lt;/li&gt;
&lt;li&gt;An HTML file which will contain our template.&lt;/li&gt;
&lt;li&gt;A CSS file for component specific styling,&lt;/li&gt;
&lt;li&gt;And a spec file, generated in Typescript, for testing purposes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The business logic for Angular components is contained in within their respective “component.ts” files.  So, to give our app some functionality, open up the “chuck-norris-facts.component.ts” and enter/copy and paste the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;OnInit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;FactsService&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../facts.service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app-chuck-norris-fact&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;templateUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./chuck-norris-fact.component.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;styleUrls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./chuck-norris-fact.component.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ChuckNorrisFactComponent&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;OnInit&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;chuckNorrisFact&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;factsService&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FactsService&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;ngOnInit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;getFact&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;factsService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getChuckNorrisFact&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;handleSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;handleError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;handleSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chuckNorrisFact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chuckNorrisFact&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;handleError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without delving each line of code and for the sake of brevity, I’ll quickly go over the main parts of this file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first couple lines of code import our required components for Angular components and a “FactsService” (which we will implement shortly).&lt;/li&gt;
&lt;li&gt;Then we have the @Component decorator which contains the metadata for this specific component.&lt;/li&gt;
&lt;li&gt;Next, we have our exported “ChuckNorrisFactComponent” class which contains the business logic for our component:

&lt;ul&gt;
&lt;li&gt;First we have our constructor which initializes our “FactsService”&lt;/li&gt;
&lt;li&gt;And, then we have our 3 main methods:&lt;/li&gt;
&lt;li&gt;The getFact() method which calls the factsService method, getChuckNorrisFact(), to actually retrieve a fact from the &lt;a href="https://api.chucknorris.io/" rel="noopener noreferrer"&gt;Chuck Norris API&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;The handleSuccess() method, which handles the data we get back from the API if the API call successfully returned the expected data&lt;/li&gt;
&lt;li&gt;And finally, the handleError() method, which will log an error to the console if retrieving the right data fails.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  Generating a Service
&lt;/h3&gt;

&lt;p&gt;Next, let’s create that “FactsService” mentioned above to carry out the call to the Chuck Norris API.&lt;/p&gt;

&lt;p&gt;Like before, click on the “generate” icon on the left hand side of AC and then scroll down and select the “service” option.  In the following window, enter “facts” in the name field and then “chuck-norris-facts” in the project field and then hit “Generate”.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2k0sq0ceq7gzpiwdyjap.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2k0sq0ceq7gzpiwdyjap.PNG" alt="Alt Text" width="748" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And just like that, we have a “facts.service.ts” file under our “apps” folder that will hold the code for our call to the Chuck Norris API.&lt;/p&gt;

&lt;p&gt;Pull up VS Code and enter the following code in the freshly generated “facts.service.ts” file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Injectable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HttpClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/common/http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Injectable&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;providedIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FactsService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;httpClient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HttpClient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;getChuckNorrisFact&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;httpClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.chucknorris.io/jokes/random?category=dev&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We’re importing the “HttpClient” component needed make our get request (in line #2)&lt;/li&gt;
&lt;li&gt;The “Generate service” command gives us an “@Injectable” decorator to make injecting our service into other components a breeze.&lt;/li&gt;
&lt;li&gt;Next, we’re exporting our “FactsService” class that contains two pieces:

&lt;ul&gt;
&lt;li&gt;The constructor, which initializes the HttpClient component&lt;/li&gt;
&lt;li&gt;And lastly, the getChuckNorrisFact() method uses the httpClient get method to fetch data from ‘&lt;a href="https://api.chucknorris.io/jokes/random?category=dev%E2%80%98" rel="noopener noreferrer"&gt;https://api.chucknorris.io/jokes/random?category=dev‘&lt;/a&gt;.  Notice here that we’re retrieving facts from the ‘dev’ category so we can display tech themed Chuck Norris facts, of course!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Now flip over to ‘app.module.ts’ and copy and paste the following to plug in Angular’s &lt;a href="https://angular.io/guide/http" rel="noopener noreferrer"&gt;HttpClient&lt;/a&gt; module capabilities into the project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;BrowserModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/platform-browser&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NgModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HttpClientModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/common/http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AppComponent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./app.component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ChuckNorrisFactComponent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./chuck-norris-fact/chuck-norris-fact.component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;declarations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;AppComponent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;ChuckNorrisFactComponent&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;BrowserModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;HttpClientModule&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="na"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AppComponent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’re almost done!  Before launching our application, let’s add our templates.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4133rcu610ujwnzkm7xl.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4133rcu610ujwnzkm7xl.png" alt="Alt Text" width="295" height="303"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Templates to display our data
&lt;/h3&gt;

&lt;p&gt;Now that we have a service to wrangle up some rather interesting, tech-themed Chuck Norris facts, let’s code up the ‘chuck-norris-fact-component’ and ‘app.component’ HTML files to display this data to the world.&lt;/p&gt;

&lt;p&gt;Switch over to ‘chuck-norris-fact-component.html’, delete the &lt;code&gt;&amp;lt;p&amp;gt;chuck-norris-fact works!&amp;lt;/p&amp;gt;&lt;/code&gt; bit, and &lt;em&gt;punch&lt;/em&gt; in the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"display: flex; justify-content: center;
    align-items: center; flex-direction: column;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Chuck Norris Facts&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;{{ chuckNorrisFact }}&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;(click)=&lt;/span&gt;&lt;span class="s"&gt;"getFact()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Get fact&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks to Angular’s &lt;a href="https://angular.io/guide/template-syntax#interpolation-and-template-expressions" rel="noopener noreferrer"&gt;interpolation&lt;/a&gt;, the ‘chuckNorrisFact’ in double curly braces will easily allow us to display the random Chuck Norris fact we receive in the Facts service.  We also added some in-line layout adjustments using the flex property to give our app a smidge of responsive design.  So, no matter what device the user is on, the content is centered and go to go.  Next, we added “Chuck Norris Facts” as a header for our application and a simple button that will fire the “getFact()” method we previously defined up above in the ‘chuck-norris-fact-component.ts’ file.&lt;/p&gt;

&lt;p&gt;Then in ‘app-component.html’, go ahead and remove everything and simply replace it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;app-chuck-norris-fact&amp;gt;&amp;lt;/app-chuck-norris-fact&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This injects an instance of the ‘chuck-norris-fact’ component, via the selector property, into our main app component.  Our users can officially see and interact with our application now.&lt;/p&gt;

&lt;p&gt;With the coding part complete, lets use Angular Console to check out our new application!&lt;/p&gt;




&lt;h3&gt;
  
  
  Launching our application
&lt;/h3&gt;

&lt;p&gt;Our code is now in place, so let’s launch “Chuck Norris Facts” and see our app in action!&lt;/p&gt;

&lt;p&gt;Head back to AC and flip over to the main project view.  From here, click on the ‘Run’ button to the right of the project name, and then hit ‘Serve’.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkewwsdizu9aqshw0gra.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkewwsdizu9aqshw0gra.PNG" alt="Alt Text" width="717" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next screen, Angular Console presents us with some handy configuration options when serving up our application.  We see options for serving up a production-ready build and using &lt;a href="https://angular.io/guide/aot-compiler#the-ahead-of-time-aot-compiler" rel="noopener noreferrer"&gt;Ahead of Time&lt;/a&gt; (aot) compilation.  For our purposes here, leave everything as-is and hit the ‘Run’ button.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78bwej5w4x80jhhpygxd.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78bwej5w4x80jhhpygxd.PNG" alt="Alt Text" width="717" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once AC has finished building our awesome new Chuck Norris app, we’re presented with a helpful ‘Summary’ screen of the build results.  If everything compiled as expected, hit the ‘Open App’ button under the green check mark.  Angular Console will then automatically load up ‘Chuck Norris Facts’ on ‘localhost:4200’ using your default 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ufg057p7ef42ra1dksp.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ufg057p7ef42ra1dksp.PNG" alt="Alt Text" width="641" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see,  we have our web application deployed in the browser and ready for the end user.  Sweet!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fthbdb4db923sxmaorld4.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fthbdb4db923sxmaorld4.PNG" alt="Alt Text" width="348" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And just like that, we have ourselves a fully fledged Angular application!  Awesome!  Now hit that ‘Get fact’ button and discover some butt-kicking, tech-themed, Chuck Norris facts!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1qvwz8gs4ktjenika4d.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1qvwz8gs4ktjenika4d.PNG" alt="Alt Text" width="724" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit the ‘Get fact’ button again to display a new fact. Now you’ll be a Chuck Norris trivia expert in no time!&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As we’ve seen, Angular Console provides us with an amazing set of easy to use tools and configuration options.  From spinning up a new application, to adding feature-ready components and services to an already established project, AC offers up an awesome alternative to the more traditional methods of working within the Angular ecosystem.  With updates coming with each new iteration of Angular, AC is certainly a handy tool to have at your disposal when experimenting with &lt;a href="https://blog.angular.io/tagged/release%20notes" rel="noopener noreferrer"&gt;new&lt;/a&gt; and &lt;a href="https://angular.io/guide/updating#learning-about-new-features" rel="noopener noreferrer"&gt;upcoming&lt;/a&gt; framework features.&lt;/p&gt;

&lt;p&gt;I highly encourage beginners and pros alike to give Angular Console a spin in their next Angular related coding ventures.  Explore more of AC’s tools and try adding &lt;a href="https://material.angular.io/" rel="noopener noreferrer"&gt;Angular Material&lt;/a&gt; (Angular’s material design component library) to Chuck Norris Facts, and update the existing ‘Get fact’ &lt;a href="https://material.angular.io/components/button/examples" rel="noopener noreferrer"&gt;button&lt;/a&gt;.  Or, if you’re feeling up to the challenge, add &lt;a href="https://angular.io/guide/universal" rel="noopener noreferrer"&gt;Angular Universal&lt;/a&gt; to your existing projects using Angular Console to give your apps &lt;a href="https://angular.io/guide/universal#why-use-server-side-rendering" rel="noopener noreferrer"&gt;serverless capabilities&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now you have Chuck Norris level Angular skills!&lt;/p&gt;

&lt;h3&gt;
  
  
  Links:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/NathanPickard/chuck-norris-facts" rel="noopener noreferrer"&gt;Chuck Norris Facts on GitHub&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://d3eneqrgz26ovv.cloudfront.net/" rel="noopener noreferrer"&gt;Link to live site&lt;/a&gt; hosted on Amazon Web Services (AWS) &lt;a href="https://aws.amazon.com/s3/" rel="noopener noreferrer"&gt;S3&lt;/a&gt;/&lt;a href="https://aws.amazon.com/cloudfront/" rel="noopener noreferrer"&gt;Cloudfront&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8x10mojgwunhnmonj080.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8x10mojgwunhnmonj080.png" alt="Alt Text" width="800" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for following along!  Connect with me on &lt;a href="https://twitter.com/NathanPickard" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://github.com/NathanPickard" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and follow &lt;a href="https://nathanpickard.wordpress.com" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy coding!&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;(&lt;strong&gt;&lt;em&gt;Originally published at &lt;a href="https://nathanpickard.wordpress.com/2019/09/16/lets-use-angular-console/" rel="noopener noreferrer"&gt;https://nathanpickard.wordpress.com/2019/09/16/lets-use-angular-console/&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;)&lt;/p&gt;

</description>
      <category>angular</category>
      <category>webdev</category>
      <category>typescript</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
