<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[SlackerNoon - Medium]]></title>
        <description><![CDATA[For those who slack at noon - Medium]]></description>
        <link>https://medium.com/slackernoon?source=rss----a608ea46d702---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>SlackerNoon - Medium</title>
            <link>https://medium.com/slackernoon?source=rss----a608ea46d702---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 18:01:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/slackernoon" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Inside a Dev Container: How to Standardize .NET Development in a Secured, Repeatable Environment]]></title>
            <link>https://medium.com/slackernoon/inside-a-dev-container-how-we-standardized-net-development-in-a-secured-repeatable-environment-5ccadd163bc0?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/5ccadd163bc0</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Tue, 29 Jul 2025 23:04:25 GMT</pubDate>
            <atom:updated>2025-07-30T13:30:33.279Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*14NfkQrXNLgNUQ-1.jpg" /></figure><h3>Inside a Dev Container: How to Standardize .NET Development in a Secured, Repeatable Environment</h3><p><strong>By Chris House, Technical Architect</strong></p><p>Spinning up a .NET application locally in a corporate environment often turns into an exercise in frustration. Developers deal with inconsistent SDK versions, corporate proxy certificates, authentication errors against private feeds, and missing tools. Instead of writing code, they spend hours configuring machines.</p><p><strong>Dev Containers fix that.</strong></p><p>Dev Containers are Docker-based development environments defined using .devcontainer config files and launched via Visual Studio Code. By defining your development environment as code, Dev Containers let you version, automate, and standardize everything needed to get up and running — regardless of which machine or developer is involved.</p><h3>Why This Matters</h3><pre>| Problem                          | Solved by                                                  <br>|----------------------------------|-------------------------------------------------------------<br>| Proxy certificate errors         | Trusting Zscaler root certs                                 <br>| HTTPS dev environment            | `dotnet dev-certs https`                                   <br>| NuGet feed authentication        | `dotnet nuget add source` with a secure Personal Access Token (PAT) <br>| &quot;It works on my machine&quot; bugs    | Identical container builds                                  <br>| Inconsistent SDKs and tools      | Pinned versions in Docker image                             </pre><p>Whether onboarding new developers or debugging issues across machines, Dev Containers give us a consistent, secure, and versioned workspace — every time.</p><h3>The Dockerfile: Building a Reliable .NET Environment</h3><p>We use Microsoft’s official .NET SDK 8.0 image as our base:</p><pre>FROM mcr.microsoft.com/dotnet/sdk:8.0</pre><h3>Key Features</h3><ul><li><strong>Private NuGet feed authentication<br></strong>We use a Personal Access Token (PAT) to connect to Azure DevOps feeds securely. This is injected as a build argument and configured at build time:</li></ul><pre>RUN dotnet nuget add source &quot;${ADO_FEED_URL}&quot; \<br>    --name &quot;AzureDevOps&quot; \<br>    --username &quot;${ADO_FEED_USER}&quot; \<br>    --password &quot;${ADO_FEED_PAT}&quot; \<br>    --store-password-in-clear-text</pre><p><strong>Is </strong><strong>--store-password-in-clear-text secure?</strong><br>This option is required when using dotnet nuget add source with credentials. While storing the password in plain text is not ideal for production containers, it is acceptable in <strong>temporary dev containers</strong> that are not distributed or reused. To enhance security, avoid checking in any secrets and limit access to the container environment.</p><ul><li><strong>Zscaler root certificate installation<br></strong>In a corporate environment with deep packet inspection (like Zscaler), HTTPS traffic can be intercepted unless root certificates are trusted. We add the cert manually:</li></ul><pre>COPY ZscalerRootCerts/ZscalerRootCertificate.crt /usr/local/share/ca-certificates/<br>RUN update-ca-certificates</pre><ul><li><strong>Dev HTTPS certificate setup<br></strong>We generate and trust the HTTPS developer certificate so ASP.NET Core can serve over HTTPS locally:</li></ul><pre>RUN dotnet dev-certs https --clean &amp;&amp; \<br>    dotnet dev-certs https --trust || true</pre><ul><li><strong>Standard tooling<br></strong>We install common tools (curl, git, vim, etc.) so the container can support debugging, scripting, and customization.</li></ul><p><strong>Complete DockerFile</strong></p><pre>FROM mcr.microsoft.com/dotnet/sdk:8.0<br><br># Accept build args<br>ARG ADO_FEED_URL<br>ARG ADO_FEED_USER<br>ARG ADO_FEED_PAT<br><br># Required ENV vars<br>ENV DOTNET_USE_POLLING_FILE_WATCHER=1 \<br>    ASPNETCORE_URLS=http://+:8080 \<br>    DOTNET_RUNNING_IN_CONTAINER=true \<br>    NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED=true<br><br># Install tools<br>RUN apt-get update &amp;&amp; \<br>    apt-get install -y --no-install-recommends \<br>    ca-certificates \<br>    curl \<br>    wget \<br>    gnupg \<br>    git \<br>    unzip \<br>    bash \<br>    vim &amp;&amp; \<br>    apt-get clean &amp;&amp; \<br>    rm -rf /var/lib/apt/lists/*<br><br># Add Zscaler certs (if needed in your org)<br>COPY [&quot;ZscalerRootCerts/ZscalerRootCertificate.crt&quot;, &quot;/usr/local/share/ca-certificates/ZscalerRootCertificate.crt&quot;]<br>COPY [&quot;ZscalerRootCerts/ZscalerRootCertificate.crt&quot;, &quot;/etc/ssl/certs/ZscalerRootCertificate.crt&quot;]<br>RUN update-ca-certificates<br><br># Set up NuGet source securely (no need for VSS env)<br>RUN dotnet nuget add source &quot;${ADO_FEED_URL}&quot; \<br>    --name &quot;AzureDevOps&quot; \<br>    --username &quot;${ADO_FEED_USER}&quot; \<br>    --password &quot;${ADO_FEED_PAT}&quot; \<br>    --store-password-in-clear-text<br><br># Install ASP.NET dev certs<br>RUN dotnet dev-certs https --clean &amp;&amp; \<br>    dotnet dev-certs https --trust || true<br><br># Final devcontainer setup<br>WORKDIR /workspace<br>EXPOSE 80<br>EXPOSE 443</pre><h3>devcontainer.json: Wiring VS Code into the Container</h3><p>The devcontainer.json file tells VS Code how to build and configure the container:</p><pre>&quot;dockerFile&quot;: &quot;../Dockerfile&quot;,<br>&quot;build&quot;: {<br>  &quot;args&quot;: {<br>    &quot;ADO_FEED_URL&quot;: &quot;...&quot;,<br>    &quot;ADO_FEED_USER&quot;: &quot;...&quot;,<br>    &quot;ADO_FEED_PAT&quot;: &quot;...&quot;<br>  }<br>},<br>&quot;workspaceFolder&quot;: &quot;/workspace&quot;,<br>&quot;remoteUser&quot;: &quot;root&quot;,<br>&quot;customizations&quot;: {<br>  &quot;vscode&quot;: {<br>    &quot;extensions&quot;: [&quot;ms-dotnettools.csharp&quot;]<br>  }<br>}</pre><p>This defines the build args, mounts your local code folder into /workspace, sets up common VS Code extensions, and runs the container as root for ease of configuration.</p><h3>End Result</h3><p>Every developer on the team — regardless of their host OS or permissions — can run:</p><pre>dotnet restore<br>dotnet run</pre><p>…and everything works.</p><p>There are no surprises around certificate trust, no more configuring private feeds manually, and no wasted time figuring out what’s missing from a machine. It just works, every time.</p><h3>📁 <strong>Sample Folder Structure</strong></h3><pre>MyDotNetApp/<br>├── .devcontainer/<br>│   ├── devcontainer.json<br>│   └── Dockerfile            # Or point to ../Dockerfile if stored one level up<br>│<br>├── ZscalerRootCerts/<br>│   └── ZscalerRootCertificate.crt<br>│<br>├── src/<br>│   └── MyDotNetApp/<br>│       ├── MyDotNetApp.csproj<br>│       ├── Program.cs<br>│       └── Startup.cs        # If using ASP.NET Core<br>│<br>├── MyDotNetApp.sln<br>└── README.md</pre><h3><strong>How to Use</strong></h3><p>If you’re new to Dev Containers, getting started is simple — especially in Visual Studio Code.</p><p><strong>Prerequisites</strong></p><ul><li>Install Docker Desktop (or Podman + Docker CLI on Linux)</li><li>Install Visual Studio Code</li><li>Install the Dev Containers extension from the Marketplace: <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers">https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers</a></li></ul><h3>Steps to Use</h3><ol><li>Clone your repository and make sure the .devcontainer folder exists in place.</li><li>Open the repo in VS Code.</li><li>Press F1 (or Ctrl+Shift+P) and run:<br>Dev Containers: Reopen in Container</li><li>VS Code will build and launch the container, automatically installing dependencies, mounting your source code, and setting up extensions.</li><li>Once the container opens, use the terminal or debugging features as you normally would. You’re now working inside the container.</li></ol><h3>Add a launch.json to launch the app</h3><p>For .NET apps, add a .vscode/launch.json file to let VS Code run and debug the app inside the container:</p><pre>{<br>  &quot;version&quot;: &quot;0.2.0&quot;,<br>  &quot;configurations&quot;: [<br>    {<br>      &quot;name&quot;: &quot;.NET Core Launch (web)&quot;,<br>      &quot;type&quot;: &quot;coreclr&quot;,<br>      &quot;request&quot;: &quot;launch&quot;,<br>      &quot;preLaunchTask&quot;: &quot;build&quot;,<br>      &quot;program&quot;: &quot;${workspaceFolder}/bin/Debug/net8.0/MyDotNetApp.dll&quot;,<br>      &quot;args&quot;: [],<br>      &quot;cwd&quot;: &quot;${workspaceFolder}&quot;,<br>      &quot;stopAtEntry&quot;: false,<br>      &quot;serverReadyAction&quot;: {<br>        &quot;action&quot;: &quot;openExternally&quot;,<br>        &quot;pattern&quot;: &quot;Now listening on: (https?://\S+)&quot;<br>      },<br>      &quot;env&quot;: {<br>        &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;<br>      },<br>      &quot;sourceFileMap&quot;: {<br>        &quot;/Views&quot;: &quot;${workspaceFolder}/Views&quot;<br>      }<br>    }<br>  ]<br>}</pre><h3>Final Thoughts</h3><p>Dev Containers have turned complex setup into a repeatable, version-controlled process. In enterprise environments, where security, repeatability, and private package feeds add complexity, Dev Containers let developers focus on building software instead of fixing environments.</p><p>Learn more: <a href="https://containers.dev/">https://containers.dev</a></p><p>— <br><em>Chris House</em><br>Technical Architect</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ccadd163bc0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/inside-a-dev-container-how-we-standardized-net-development-in-a-secured-repeatable-environment-5ccadd163bc0">Inside a Dev Container: How to Standardize .NET Development in a Secured, Repeatable Environment</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crud cheatsheet for Firebase and Angular]]></title>
            <link>https://medium.com/slackernoon/crud-cheatsheet-for-firebase-and-angular-4846fce54e5a?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/4846fce54e5a</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Mon, 17 Feb 2020 13:19:36 GMT</pubDate>
            <atom:updated>2020-02-17T13:19:23.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8LjUUpPNMwrutD5mee2pw.png" /></figure><p>Firebase Cloud Firestore is “the next generation of the Realtime Database with more powerful queries and automatic scaling.” It is was acquired by Google in 2014, and is a realtime cloud-based NoSql database solution.</p><p>This article aims to show you how to perform basic NoSql Crud operations using Angular 9. I have written previous articles on how to set up Firebase with angular, and will link them at the bottom.</p><p>One of my favorite aspects of Firestore and Angular is the socket connection to the database will live update your Angular components whenever a crud operation happens.</p><p><strong>C — Create</strong></p><p>On all four operations, you will need to inject a Firestore database reference like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e46104c75365c094795b1ac5841cb547/href">https://medium.com/media/e46104c75365c094795b1ac5841cb547/href</a></iframe><p>In out html, we will be using a reactive form to create our database record.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3145b66e14e249d828562c2106a54fee/href">https://medium.com/media/3145b66e14e249d828562c2106a54fee/href</a></iframe><p>We will declare our form to match the database schema.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaca9f1d2639c645a6acdab42ccb0045/href">https://medium.com/media/eaca9f1d2639c645a6acdab42ccb0045/href</a></iframe><p>Once the form is valid, and a button is clicked, we are now ready to insert a record into our database.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5076433399a223d604cd20bdd0557396/href">https://medium.com/media/5076433399a223d604cd20bdd0557396/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8NhFW2oLXgyEupgtpNXjw.png" /></figure><p>If you go to the Firebase console, you will now see your newly inserted record.</p><p><strong>R — Read</strong></p><p>Read can start out looking like:</p><pre>this.jobs = db<br>.collection&lt;any&gt;(‘jobs’)<br>.valueChanges();</pre><p>and you can bind `this.jobs` to a table using an async pipe to get all the jobs collection. Where it gets interesting is when you want to delete a record. By default subscribing to the valueChanges() function, does not include the database Id’s. Below is an example of how I am getting the Id’s in preparation for delete/update events.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a633636cd7ec1c451fc8dc59c63852df/href">https://medium.com/media/a633636cd7ec1c451fc8dc59c63852df/href</a></iframe><p><strong>U — Update</strong></p><p>In this example, I am passing the database id as a parameter to my component. I am hooking it up to the same form from before, and defaulting the values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26591671aa3ba1f61803c1199b6fe521/href">https://medium.com/media/26591671aa3ba1f61803c1199b6fe521/href</a></iframe><p>When edits are made and save button hit, it will call the editJob() function.</p><p><strong>D — Delete</strong></p><p>Delete method needs to have the firestore document id. I showed how to map to that in the Read action above.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f17b2172327bd8acd54bc7c155cecd2/href">https://medium.com/media/7f17b2172327bd8acd54bc7c155cecd2/href</a></iframe><p><a href="https://blog.cloudboost.io/angular-5-with-firebases-cloud-firestore-87b5d6c13ff">Link to how to set up angular and firebase</a><br><a href="https://github.com/crh225/angular-github-issues">Link to working repository and code</a><br><a href="https://christopher.house/jobs/search">Demo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4846fce54e5a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/crud-cheatsheet-for-firebase-and-angular-4846fce54e5a">Crud cheatsheet for Firebase and Angular</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Performance Enhancement]]></title>
            <link>https://medium.com/slackernoon/angular-performance-enhancement-413c6f950ebb?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/413c6f950ebb</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Mon, 26 Aug 2019 00:52:48 GMT</pubDate>
            <atom:updated>2019-08-26T01:21:34.785Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular Performance Advice</h3><h3>Avoid Computing Values in the Template</h3><p>Sometimes in Angular templates, we may be tempted to bind a function in the html template:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2b6de96b9bb6e3a757893ea1aee34b6/href">https://medium.com/media/f2b6de96b9bb6e3a757893ea1aee34b6/href</a></iframe><p>getColor() calls a function to get the color for the background.</p><p><strong>Problem: getColor() is constantly getting called during the Angular change detection cycle.</strong></p><p><strong>Proof</strong>: put a console.log() or breakpoint on your function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVWlF_21Io5rumuwkQpZyg.png" /><figcaption><a href="https://stackblitz.com/edit/angular-o7prqm?file=src/app/app.component.html">https://stackblitz.com/edit/angular-o7prqm?file=src/app/app.component.html</a></figcaption></figure><p>This example shows that the getColor() function get’s called at least four times. Now image the style is on a table or grid for every single column, or every single cell.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fe8fcbe7232a14ee78d2991fabd2c19/href">https://medium.com/media/7fe8fcbe7232a14ee78d2991fabd2c19/href</a></iframe><p>Here the function gets called 95 Times, when it should only get called 24 times.</p><p>In our example getColor() always returns the same value: red.</p><p>What we could do is introduce a <a href="https://angular.io/guide/pipes#pure-pipes">pure pipe</a>. “ Angular executes a <em>pure pipe</em> only when it detects a <em>pure change</em> to the input value.”</p><p>The pipe below takes the value to be transformed, and sets it as the background color.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6fd3c2d56d18acd46402fc2f55e19e9/href">https://medium.com/media/d6fd3c2d56d18acd46402fc2f55e19e9/href</a></iframe><p>See the stackblitz link below for the new html implementation, but keep in mind this is just an example. You most likely will be passing in a row number to get odd or even rows, then returning the background color for a zebra colored table.<br><a href="https://stackblitz.com/edit/angular-fxdwjh?file=src/app/app.component.html">https://stackblitz.com/edit/angular-fxdwjh?file=src/app/app.component.html</a></p><p>As we expect 24 function calls, we get exactly 24 function calls with this pipe.</p><p><strong>Why? because this is a pure pipe, and only detects a pure change to the input value.</strong></p><p>Lets add a button, and a No-op click event to both the pipe example, and the bad example that calls a function.</p><p><strong>Pipe example</strong>: <a href="https://stackblitz.com/edit/angular-fxdwjh?file=src/app/app.component.html">https://stackblitz.com/edit/angular-fxdwjh?file=src/app/app.component.html</a></p><p>What you will notice on the pipe example is when the button is clicked, no extra change detection is firing. We still get the same 24 pure function calls.</p><p><strong>Function example</strong>: <a href="https://stackblitz.com/edit/angular-fxdwjh?file=src/app/app.component.html">https://stackblitz.com/edit/angular-fxdwjh?file=src/app/app.component.html</a></p><p>In this example, every time anything changes, angular will run the full change detection on the `getColor()` function since it is bound in the template. Just five clicks produces over 380 function calls.</p><p>This is only one function on a simple page. Imagine multiple tables on a screen and many clickable actions taking place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=413c6f950ebb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/angular-performance-enhancement-413c6f950ebb">Angular Performance Enhancement</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use typescript aliases to clean up your import statements]]></title>
            <link>https://medium.com/slackernoon/use-typescript-aliases-to-clean-up-your-import-statements-7210b7ec2af1?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/7210b7ec2af1</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Fri, 09 Aug 2019 19:24:08 GMT</pubDate>
            <atom:updated>2019-08-09T19:27:25.658Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*deUpbSJe5Ak4-6glVvCuSg.png" /><figcaption>source: MSPaint</figcaption></figure><p>We can create prettier imports by defining the paths and baseUrl properties in the compilerOptions section in thetsconfig.json file.</p><p>Given the below code, we could refactor into one import statement, and clean up the ../../../ in the process.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f41613bb000920d0da0f29040a4faace/href">https://medium.com/media/f41613bb000920d0da0f29040a4faace/href</a></iframe><p>First, we will change our tsconfig.json to the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5b07de244ab658fd8380cdb4f1b433a/href">https://medium.com/media/d5b07de244ab658fd8380cdb4f1b433a/href</a></iframe><p>Now we will be able to re-factor the imports into the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e1b71fada51bc052bfb771be8f8c20a/href">https://medium.com/media/7e1b71fada51bc052bfb771be8f8c20a/href</a></iframe><p>We could also have used <a href="https://medium.com/hackernoon/react-project-architecture-using-barrels-d086146eb0f6">barrels</a> to rewrite the import statement into one line of code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f3ca518c2e0de9c344a3e385e30c9c7/href">https://medium.com/media/0f3ca518c2e0de9c344a3e385e30c9c7/href</a></iframe><p>The major benefit of this comes into play when we need to refactor our components. When we move components around it can create more folders, and therefore create more ../../../ , but if we use aliases and barrels we wont have to update the import statements.</p><p>Reference: <a href="https://github.com/labs42io/clean-code-typescript#use-typescript-aliases">https://github.com/labs42io/clean-code-typescript#use-typescript-aliases</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7210b7ec2af1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/use-typescript-aliases-to-clean-up-your-import-statements-7210b7ec2af1">Use typescript aliases to clean up your import statements</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Translating Angular Form Error Messages]]></title>
            <link>https://medium.com/slackernoon/translating-angular-form-error-messages-6bae3218385?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/6bae3218385</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angularjs]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Wed, 07 Aug 2019 19:30:51 GMT</pubDate>
            <atom:updated>2019-08-07T19:53:42.130Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ojUXJE1pv8slms2H.png" /></figure><p>In part <strong>Three </strong>of my Angular Form Series, I am going to introduce a pipe to translate error codes into their appropriate spoken language.</p><p><a href="https://medium.com/slackernoon/error-pipes-for-angular-form-validation-976db3528ee6">In my previous article</a> I explain how to use a generic error pipe to control all error messages for a form control.</p><p>Again we will start with a <strong>login form</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/0*L0IbWtsVc9KRXha3.png" /></figure><p>I want to introduce a language translation npm package called ngx-translate.</p><p>To install the package, you can run in the command line:<br>npm install @ngx-translate/core — save</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*mURrZi0mFy7iBrrucuMx3Q.png" /></figure><p>You will need to create your language asset files for each language you intend on translating.</p><p>Also you will need to set up your app module to include the translation module. You can see how I did it <a href="https://stackblitz.com/edit/angular-7-reactive-form-example-5tk8tk?file=src%2Fapp%2Fapp.module.ts">here</a>.</p><p>The next thing we need is a dropdown list to control the currently select language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*KSOf3lz1h9d-qUl2ywRSIg.png" /></figure><p>In our constructor, we inject the translate dependency, and set up the default language based on the browser’s default language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*8iFf6R8wnonZjWZw652cFQ.png" /></figure><p>I want to translate the username field, and all error messages. Here is what the asset file looks like for English:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*BHtz0za-_V4rmgYsB_RdJw.png" /></figure><p>Our error pipe from the previous article changes a little to match the new JSON format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*asYelkwgPd9A51V4Fico0A.png" /></figure><p>Now, this input error pipe’s output will be fed into the translation pipe. And thus, we will get our error message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*R7ARPFbWFfa6OBgXhHGv9A.png" /></figure><p>When we switch the language from English to French, it will automatically change the error message on the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*-5Rpy5TINhJ5HyGN--wU5A.png" /></figure><p><a href="https://stackblitz.com/edit/angular-7-reactive-form-example-5tk8tk?file=src%2Fapp%2Fapp.component.html">H<strong>ere is the full stackblitz example</strong></a></p><p>The next logical task at hand is to create a input error component, so its style can be reused across the application.</p><p><a href="https://stackblitz.com/edit/angular-7-reactive-form-example-vbpvko?file=src/app/app.component.html">Here </a>you will see it broken out into an error component.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bae3218385" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/translating-angular-form-error-messages-6bae3218385">Translating Angular Form Error Messages</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Error Pipes for Angular Form Validation]]></title>
            <link>https://medium.com/slackernoon/error-pipes-for-angular-form-validation-976db3528ee6?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/976db3528ee6</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Wed, 07 Aug 2019 18:43:22 GMT</pubDate>
            <atom:updated>2019-08-07T19:33:02.156Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-jVr6j-ruR8lIg6I.png" /></figure><p>In part <strong>two </strong>of my Angular Form Series, I am going to introduce a pipe to translate error codes into strings which will reduce the amount of html needed to display the errors.</p><p><a href="https://medium.com/slackernoon/angular-forms-and-aync-validator-functions-a663b01e9832">In my previous article</a> I explain how to use Async form validators for custom validation at run time.</p><p>Again we will start with a <strong>login form</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/0*f564vBUWye5icOkq.png" /></figure><p>The goal here is to replace inline html error messages with a pipe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*IFn5O8CfbhJbZpbaSIueJg.png" /></figure><p>Here we have two different error messages that will show if the field is invalid, and a different div will show if the username exists already.</p><p>My goal is to reduce the custom html error messages, and have one div to handle all messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*5JDMKTMmkL_xNqCN9qDIFA.png" /></figure><p>The final html code is above. It says, if there are errors on this field, no matter the amount of errors, send them through the <strong>inputError </strong>pipe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*8-7cT0aMdKPJJx3o9KlojA.png" /></figure><p>The pipe is quite simple in this example, and will transform the error code into a human readable string. One reason to do this is if we want to translate error messages to different languages through a language translation service. (you can also use a language translation pipe). Below we use a translation directive that receives a error code, and then it translates to whatever language we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*aRQWlN2Yy3cPNO1rusS2eg.png" /></figure><p>In a real world application you will have more codes like r<em>equired field, min length, max length, numbers greater than zero</em>, etc… You will also have custom error sentences you may want to use this for, for business rules.</p><p><a href="https://stackblitz.com/edit/angular-7-reactive-form-example-2lnsik?file=src/app/app.component.html"><strong>Full Stackblitz example</strong></a></p><p><strong>Part three</strong>: <a href="https://medium.com/slackernoon/translating-angular-form-error-messages-6bae3218385">In my next article,</a> I explain how to translate those error messages into French, and back to English!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=976db3528ee6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/error-pipes-for-angular-form-validation-976db3528ee6">Error Pipes for Angular Form Validation</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Forms and Aync Validator Functions]]></title>
            <link>https://medium.com/slackernoon/angular-forms-and-aync-validator-functions-a663b01e9832?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/a663b01e9832</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[angularjs]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Mon, 05 Aug 2019 20:24:40 GMT</pubDate>
            <atom:updated>2019-08-07T18:42:52.680Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular Forms and Async Validator Functions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AljVG6v2tWigK_KE76VGhA.png" /></figure><p>A common pattern in angular I find myself doing is to adding <em>AsyncValidatorFn </em>to my forms to check against a database that a value does not already exist.</p><p><strong>Example</strong>: Login Forms</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*k-ggP5FpJhpugv-_FUMS0A.png" /></figure><p>In this example, I want to add a <em>AsyncValidatorFn </em>to my<em> </em>formControl. This form has only one field called username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*NwWLBE6g8BKzHgXAsVgJ0w.png" /></figure><p>Based on any business scenario you may need to add or remove async validators, so here I wrap it in a function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*gKRok_Un3BktjGaaQPPy2A.png" /></figure><p>Below is the <em>AsyncValidatorFn. </em>It checks the form against a hardcoded value test@test.test, but you could change the logic for your case. It could be checking through an array (from a database) to see if the value exists or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*342Zbno4X5XYbBJc44nWRw.png" /></figure><p>After typing in the reserved test value, below you can see the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*g3XYYhFxheM6yTQVnk8nbw.png" /></figure><p><a href="https://stackblitz.com/edit/angular-7-reactive-form-example-8nhuy5?file=src/app/app.component.html">Full <strong>Stackblitz </strong>example</a></p><h4><strong>PART 2</strong>: <a href="https://medium.com/@chrishouse/error-pipes-for-angular-form-validation-976db3528ee6">Error Pipes for Angular Form Validation</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a663b01e9832" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/angular-forms-and-aync-validator-functions-a663b01e9832">Angular Forms and Aync Validator Functions</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to get a Business eVisa for India in 2019]]></title>
            <link>https://medium.com/slackernoon/how-to-get-a-business-evisa-for-india-in-2019-ff93bb823cd5?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/ff93bb823cd5</guid>
            <category><![CDATA[traveling]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[travel-tips]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[travel-writing]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Wed, 05 Jun 2019 15:13:18 GMT</pubDate>
            <atom:updated>2019-06-05T13:43:14.498Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*-LYdTer0syickfu7.jpg" /><figcaption><a href="https://breathedreamgo.com/guide-indian-visa-application-tourists/">https://breathedreamgo.com/guide-indian-visa-application-tourists/</a></figcaption></figure><p>You may need to go to India for a business trip at some point in your career. My HR department said I can do it myself online. They made it sound easy!</p><p>What they did not tell me was their is an official government site, and also 20 other sites that look similar, but charge a fee 30–50$USD just for booking your visa.</p><p>The official site is <a href="https://indianvisaonline.gov.in/evisa/tvoa.html">https://indianvisaonline.gov.in/evisa/tvoa.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2285Y55ueIOKKfbw5wfSUA.png" /><figcaption>click on Apply here for an e-visa</figcaption></figure><p>This will take you to a website that now looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pntcDptvJbt-jSBXpor1JQ.png" /></figure><p>If you are taking a business trip you will need to select eBusiness Visa, and then Expert/Specialist in connection with a project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*Ser8hNpQdWtaG2-6Kk0EpQ.png" /></figure><p>Here is an example of another website that looks similar, but charges a fee:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jttm5q_tIGv82w-fmiYp_g.png" /></figure><p>If you choose to not use the government eVisa website and choose this one, you will be getting phone calls from India, and quite a few emails over the course of two days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S4Yrh7Pu7KcKMnsDYgNV4A.png" /><figcaption>Typical disclaimer</figcaption></figure><p>Above you can read a disclaimer saying they are not the government visa website. They may be a real business, but I don’t trust giving my passport and ssn to a third party website.</p><p>In total, I paid 103$ for a business eVisa. The Visa is 100$ as of 2019 and there is a processing fee. They let me pay over paypal, and the next day my eVisa was approved!</p><p>It took me in total 20 minutes to fill out the official application, but you may have some trouble getting your passport photo under 300kb! the majority of this 20 minutes was trying to make my photo smaller.</p><p>A website you can use to shrink your pdf is <a href="https://smallpdf.com/">https://smallpdf.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff93bb823cd5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/how-to-get-a-business-evisa-for-india-in-2019-ff93bb823cd5">How to get a Business eVisa for India in 2019</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When to use Angular’s forRoot() method]]></title>
            <link>https://medium.com/slackernoon/when-to-use-angulars-forroot-method-400094a0ebb7?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/400094a0ebb7</guid>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[angular-4]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Tue, 04 Jun 2019 18:57:56 GMT</pubDate>
            <atom:updated>2019-08-05T20:27:40.556Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Problem</strong>: We needed to share a singleton language service across all lazy loaded modules. For a year, I saw the forRoot() method and simply ignored its power.</p><p><strong>Explanation</strong>: The forRoot() method returns an NgModule and its provider dependencies.</p><p>In this example, we are sharing a service to keep up with a counter value. Each time any component increments the value stored in the counter service, I want to share this with all components.</p><p>The issue is when you try to introduce lazy loaded modules. Notice how the Lazy loaded component does not share the same counter value. When using eager loaded components only, the below example will work if you use a shared service, but notice how the lazy loaded component behaves. The lazy component gets its own instance of the service.</p><pre>import { NgModule } from &#39;<a href="http://twitter.com/angular/core">@angular/core</a>&#39;;<br>import { CounterService } from &#39;./counter.service&#39;;</pre><pre><a href="http://twitter.com/NgModule">@NgModule</a>({<br>  providers: [CounterService],<br>})<br>export class SharedModule {}</pre><p>See plunker: <a href="https://stackblitz.com/edit/angular-no-for-root-72x3ht?file=app/lazy/lazy.component.ts">https://stackblitz.com/edit/angular-no-for-root-72x3ht?file=app/lazy/lazy.component.ts</a></p><p><strong>Solution</strong>: Call <em>forRoot()</em> in the AppModule and return a ModuleWithProviders in the sharedModule.</p><p><strong>shared.module.ts</strong></p><pre>import { NgModule,ModuleWithProviders  } from &#39;<a href="http://twitter.com/angular/core">@angular/core</a>&#39;;<br>import { CounterService } from &#39;./counter.service&#39;;</pre><pre><a href="http://twitter.com/NgModule">@NgModule</a>({</pre><pre>})<br>export class SharedModule {<br>  static forRoot(): ModuleWithProviders {<br>    return {<br>      ngModule: SharedModule,<br>      providers: [ CounterService ]<br>    }<br>  }<br>}</pre><p><strong>app.module.ts</strong></p><pre>import { NgModule } from &#39;<a href="http://twitter.com/angular/core">@angular/core</a>&#39;;<br>import { BrowserModule  } from &#39;<a href="http://twitter.com/angular/platform-browser">@angular/platform-browser</a>&#39;;</pre><pre>import { SharedModule } from &#39;./shared/shared.module&#39;;</pre><pre>import { AppComponent } from &#39;./app.component&#39;;<br>import { EagerComponent } from &#39;./eager.component&#39;;<br>import { routing } from &#39;./app.routing&#39;;</pre><pre><a href="http://twitter.com/NgModule">@NgModule</a>({<br>  imports: [<br>    BrowserModule,<br>    SharedModule.forRoot(),<br>    routing<br>  ],<br>  declarations: [<br>    AppComponent,<br>    EagerComponent<br>  ],<br>  bootstrap: [AppComponent]<br>})<br>export class AppModule {}</pre><p>See Plunker: <a href="https://stackblitz.com/edit/angular-no-for-root-yfhkgz?file=app%2Fapp.module.ts">https://stackblitz.com/edit/angular-no-for-root-yfhkgz?file=app%2Fapp.module.ts</a></p><p>Now the counter service is shared between eagerly loaded modules and lazy loaded modules.</p><p>Other recommended readings: <a href="http://angularfirst.com/the-ngmodule-forroot-convention/">http://angularfirst.com/the-ngmodule-forroot-convention/</a></p><ul><li><em>Note: I would not recommend putting shared services and shared directives in the same module. I have written this article as a reference for myself in the future.</em></li></ul><p>Other articles:<br><a href="https://medium.com/@chrishouse/use-a-robot-to-upgrade-your-node-dependencies-bf679719a30e"> Use a Robot to upgrade your node dependencies</a></p><p><a href="https://medium.com/slackernoon/angular-forms-and-aync-validator-functions-a663b01e9832">Angular AsyncValidators</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=400094a0ebb7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/when-to-use-angulars-forroot-method-400094a0ebb7">When to use Angular’s forRoot() method</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Firebase Tutorial: Read/Write data into a NoSql Database Collection]]></title>
            <link>https://medium.com/slackernoon/firebase-tutorial-read-write-data-into-a-nosql-database-collection-920277864c1c?source=rss----a608ea46d702---4</link>
            <guid isPermaLink="false">https://medium.com/p/920277864c1c</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular2]]></category>
            <dc:creator><![CDATA[Chris House]]></dc:creator>
            <pubDate>Tue, 04 Jun 2019 18:55:05 GMT</pubDate>
            <atom:updated>2017-11-08T01:33:53.473Z</atom:updated>
            <content:encoded><![CDATA[<p>Firebase Cloud Firestore, which is currently in beta stage, is “the next generation of the Realtime Database with more powerful queries and automatic scaling.” It is was acquired by Google in 2014, and is a realtime cloud-based NoSql database solution.</p><p><strong>Step 1</strong>: Set up your environment.</p><p>To set up your Firebase environment, please see my <a href="https://blog.cloudboost.io/angular-5-with-firebases-cloud-firestore-87b5d6c13ff">previous article</a>.</p><p><strong>Step 2</strong>: Set up new collection in Firebase’s Cloud Firestore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*IUTY0gXXe2aO1_ltqfjoEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*TgTDfuyiVUVlNqwkUMU5RQ.png" /></figure><p><strong>Step 3</strong>: Modify typescript code.</p><p>In your component, we want to add a new tshirt interface.</p><pre>export interface Shirt { name: string; price: number; }</pre><p>Next we will inject the AngularFireAuth and AngularFireStore to the constructor, and subscribe to the tshirts collection.</p><p>Here is how your component should look so far:</p><pre>export class AppComponent {</pre><pre>_db:AngularFirestore;<br>shirts:  Observable&lt;any[]&gt;;</pre><pre>constructor(public afAuth: AngularFireAuth, db: AngularFirestore) {<br>    this.afAuth.auth.signInAnonymously();<br>    this.shirts = db.collection(&#39;tshirts&#39;).valueChanges();<br>    this._db = db;<br>  }<br>}</pre><p><strong>Step 4: </strong>Create a simple form in your html.</p><p>We want two textboxes, a submit button, and a way to display the realtime database collection.</p><pre>&lt;div style=&quot;text-align:center&quot;&gt;<br>    &lt;br&gt; Name:<br>    &lt;input #shirtName&gt;<br>    &lt;br&gt; Price:<br>    &lt;input #price&gt;<br>    &lt;br&gt;<br>    &lt;button (click)=&quot;addTshirt(shirtName.value, price.value)&quot;&gt;Add some shirts&lt;/button&gt;<br>    &lt;br&gt;<br>    &lt;div style=&quot;text-align:center;display:unset;&quot;&gt;<br>        List of Shirts:<br>        &lt;ul&gt;<br>            &lt;li *ngFor=&quot;let shirt of shirts | async&quot;&gt;<br>                {{ shirt.name }} is ${{ shirt.price }}<br>            &lt;/li&gt;<br>        &lt;/ul&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;</pre><p><strong>Step 5: </strong>Write a function called addTshirt() in your typescript.</p><pre>addTshirt(sName: string, dPrice: number){<br>  let shirtsCollection = this._db.collection&lt;Shirt&gt;(&#39;tshirts&#39;);<br>  shirtsCollection.add({ name: sName, price: dPrice });<br>}</pre><p><strong>Finally</strong>: Run the app.</p><p>To run in development mode, open a terminal and run:</p><pre>ng serve — open</pre><p>To build for production with AOT and treeshaking:</p><pre>ng build --prod --build-optimizer</pre><p><a href="https://github.com/crh225/AngularFireStore/tree/insert_firebase">Here </a>is the git repo.</p><p>Demo is coming <em>soon</em>. Still debating the best way to structure/host the demos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*-bhLS1Exl-GIYYrbMJXSFg.png" /><figcaption>example screenshot</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=920277864c1c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/slackernoon/firebase-tutorial-read-write-data-into-a-nosql-database-collection-920277864c1c">Angular Firebase Tutorial: Read/Write data into a NoSql Database Collection</a> was originally published in <a href="https://medium.com/slackernoon">SlackerNoon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>