<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Angular 9 - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Angular 9 - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sat, 25 Jul 2026 22:29:10 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/angular-9/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ Angular 9 for Beginners - Components and String Interpolation ]]>
                </title>
                <description>
                    <![CDATA[ By Cem Eygi In modern web development, many developers prefer to build the UI of a website in a component-based way. It's also supported by all modern frameworks. Understanding how components work and how to use them is a big step in learning Angular... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/angular-9-for-beginners-components-and-string-interpolation/</link>
                <guid isPermaLink="false">66d45ddbd7a4e35e38434947</guid>
                
                    <category>
                        <![CDATA[ Angular ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Angular 9 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 29 Apr 2020 22:23:33 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/04/Copy-of-Copy-of-Travel-Photography-1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Cem Eygi</p>
<p>In modern web development, many developers prefer to build the UI of a website in a component-based way. It's also supported by all modern frameworks. Understanding how components work and how to use them is a big step in learning Angular.</p>
<p>In this post, you're going to learn about Angular components, how to create and use a component in a project, and what string interpolation is. I will also be covering other important features of Angular in my upcoming articles:</p>
<ul>
<li><strong>Part 1:</strong> <a target="_blank" href="https://www.freecodecamp.org/news/angular-9-for-beginners-how-to-install-your-first-app-with-angular-cli/">How to install your first App with the Angular CLI</a> </li>
<li><strong>Part 2:</strong> Angular Components and String Interpolation <strong>(you’re here)</strong></li>
<li><strong>Part 3</strong>: <a target="_blank" href="https://youtu.be/3-eJ-A9rFEU">Angular Directives &amp; Pipes</a></li>
<li><strong>Part 4:</strong> <a target="_blank" href="https://youtu.be/x_vtX3vvE8k">One-Way Data Binding in Angular</a> </li>
<li><strong>Part 5:</strong> <a target="_blank" href="https://youtu.be/bKfbzpANUFE">Angular Two-Way Data Binding with ngModel</a></li>
</ul>
<p><strong>If you prefer, you can also watch the video version:</strong></p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/wXmw0FxjmTc" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-what-is-a-component">What is a Component?</h2>
<p>Components are the most basic building blocks of an Angular application. We can think of components like LEGO pieces. We create a component once but can use them many times as we need in different parts of the project.</p>
<p>An Angular component is made of 3 main parts:</p>
<ul>
<li>HTML Template —View</li>
<li>TypeScript File — Model</li>
<li>CSS File — Styling</li>
</ul>
<h3 id="heading-why-do-we-need-components">Why do we need Components?</h3>
<p>Using components is beneficial in many ways. Components divide the UI into smaller views and render data. A component should not be involved in tasks like making HTTP requests, service operations, routing, and so on. This approach keeps the code clean and separates the view from other parts (see <a target="_blank" href="https://en.wikipedia.org/wiki/Separation_of_concerns">separation of concerns</a>). </p>
<p>Another important reason is that components divide the code into smaller, reusable pieces. Otherwise, we would have to include endless lines of code in a single HTML file, which makes the code much harder to maintain.</p>
<h2 id="heading-creating-our-first-angular-component">Creating Our First Angular Component</h2>
<p>Now let's create our first component. The short way to create a component is by using Angular CLI:</p>
<pre><code>ng g c component-name
</code></pre><p>This command creates a brand new component with its own files (HTML, CSS, and TypeScript) and registers it to the App Module automatically:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/Ekran-Resmi-2020-04-29-10.59.14.png" alt="Image" width="600" height="400" loading="lazy">
<em>The App Module</em></p>
<blockquote>
<p><strong>Note:</strong> In Angular, we need to register every necessary service, component, and module to a module file.</p>
</blockquote>
<p>Now let's take a closer look at the component model (TypeScript Component File):</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/Ekran-Resmi-2020-04-29-10.57.59.png" alt="Image" width="600" height="400" loading="lazy">
<em>Inside the App Component</em></p>
<p>This is actually a TypeScript class but to define it as a component:</p>
<ul>
<li>First of all, we need to import <strong>Component</strong> from the <strong>@angular/core</strong> library, so we can use the component decorator</li>
<li>The <strong>@Component</strong> decorator marks the class as a component and allows us to add the following metadata</li>
<li>The <strong>selector</strong> is for calling the component later as an HTML tag: <code>&lt;app-root&gt; &lt;/app-root&gt;</code></li>
<li><strong>TemplateUrl</strong> is the path where the HTML View of the component is.</li>
<li><strong>S</strong>tyle URLs<em>**</em> (can be more than 1) is where the styling files of the component are.</li>
<li>Finally, we <strong>export</strong> the class (component) so that we can call it inside the <strong>app.module</strong> or other places in the project later.</li>
</ul>
<h3 id="heading-what-is-string-interpolation">What is String Interpolation?</h3>
<p>One of the most common questions people ask about Angular is what that curly braces syntax is. Components render data, but data can change in time, so it needs to be dynamic. </p>
<p>We use curly braces inside other curly braces to render dynamic data: <code>{{ data }}</code> and this representation is called string interpolation. You can see the example in the video version above.</p>
<h2 id="heading-wrap-up">Wrap Up</h2>
<p>One of the biggest steps of learning Angular is to know how to create components and use them efficiently. I hope you find this post helpful. In the next part, we are going to take a look at the Angular Directives like ng-if, ng-for, ng-class, and more. Stay tuned :)</p>
<p><strong>If you want to learn more about Web Development,</strong> <strong>feel free to</strong> <a target="_blank" href="https://www.youtube.com/channel/UC1EgYPCvKCXFn8HlpoJwY3Q"><strong>follow me on Youtube</strong></a><strong>!</strong></p>
<p>Thank you for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Angular 9 for Beginners — How to Install Your First App with Angular CLI ]]>
                </title>
                <description>
                    <![CDATA[ By Cem Eygi Angular is one of the most popular JavaScript frameworks created and developed by Google. In the last couple of years, ReactJS has gained a lot of interest and has become the most popular modern JS library in the industry. But this doesn’... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/angular-9-for-beginners-how-to-install-your-first-app-with-angular-cli/</link>
                <guid isPermaLink="false">66d45dddc7632f8bfbf1e3f3</guid>
                
                    <category>
                        <![CDATA[ Angular ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Angular 9 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 22 Apr 2020 17:44:59 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/04/Copy-of-Copy-of-Travel-Photography.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Cem Eygi</p>
<p>Angular is one of the most popular JavaScript frameworks created and developed by Google. In the last couple of years, ReactJS has gained a lot of interest and has become the most popular modern JS library in the industry. But this doesn’t mean Angular is not important anymore.</p>
<p>On the contrary, Angular is the second most popular framework after React according to Google Trends (world-wide):</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/Ekran-Resmi-2020-04-22-19.31.13.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>ReactJS</strong> is represented with blue and <strong>Angular</strong> with red (world-wide)</em></p>
<p>As a front end developer, I have worked with Angular. Now I would like to cover some important features of Angular in my upcoming articles:</p>
<ul>
<li><strong>Part 1:</strong> How to install your first App with the Angular CLI <strong>(currently you’re here)</strong></li>
<li><strong>Part 2:</strong> <a target="_blank" href="https://www.freecodecamp.org/news/angular-9-for-beginners-components-and-string-interpolation/">Angular Components &amp; String Interpolation</a></li>
<li><strong>Part 3</strong>: <a target="_blank" href="https://youtu.be/3-eJ-A9rFEU">Angular Directives &amp; Pipes</a></li>
<li><strong>Part 4:</strong> <a target="_blank" href="https://youtu.be/x_vtX3vvE8k">One-Way Data Binding in Angular</a> </li>
<li><strong>Part 5:</strong> <a target="_blank" href="https://youtu.be/bKfbzpANUFE">Angular Two-Way Data Binding with ngModel</a></li>
</ul>
<p>In the first part of my Angular for Beginners series, you’re going to learn what Angular &amp; Angular CLI is and how to install your first Angular app by using the CLI.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<p>Before starting to learn Angular, I recommend that you become familiar with the following languages if you aren't already:</p>
<ul>
<li>HTML, CSS</li>
<li>JavaScript / ES6</li>
<li>TypeScript</li>
</ul>
<p><strong>If you prefer, you can watch the tutorial video below:</strong></p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/cpq7cmj9Ih8" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-what-is-angular">What is Angular?</h2>
<p>Angular is a JavaScript framework developed and maintained by Google for building front-end applications. Let me start first explaining what a framework is…</p>
<h3 id="heading-what-is-a-framework">What is a Framework?</h3>
<p>A  Framework is a complete package with its own functionalities &amp; libraries. A Framework has its own rules, you don’t have much flexibility and the project is dependent on the Framework you use. Angular is an example of a framework.</p>
<p>Angular has released in 2016 but before Angular, there was AngularJS. One of the most asked questions about Angular is that what is the difference between AngularJS and Angular?</p>
<h2 id="heading-angularjs-vs-angular">AngularJS vs Angular</h2>
<p>These  2 versions of Angular confuse many developers. AngularJS and Angular are completely different frameworks. Angular versions (like 1, 1.2, 1.5,  etc) are called Angular JS and starting from version 2 and above is called Angular.</p>
<ul>
<li>Angular JS → versions from 1.x</li>
<li>Angular → version 2 and above</li>
</ul>
<p>So  Angular version 2 is a complete rewrite of the AngularJS framework and the newer versions (like 4,5,6 and so on) are minor changes of Angular version 2.</p>
<p><strong>In this article series, you’re going to learn Angular 2+.</strong></p>
<h1 id="heading-what-is-angular-cli">What is Angular CLI?</h1>
<p>CLI  stands for Command Line Interface. Angular has its own official CLI  that helps us with lots of things during the development process.</p>
<p><a target="_blank" href="https://cli.angular.io/">Angular CLI</a> is being used for automating operations in Angular projects rather than doing them manually. CLI supports us, developers, in an Angular project  from beginning to end.</p>
<p>For example, Angular CLI can be used for:</p>
<ul>
<li>Configurations, Environment Setup</li>
<li>Building components, services, routing system</li>
<li>Starting, testing and deploying the project</li>
<li>Installing 3rd party libraries (like Bootstrap, Sass, etc.)</li>
</ul>
<p>and much more. Now let’s see how to install our first Angular App by using the CLI step by step.</p>
<h2 id="heading-step-1-install-npm-node-package-manager">Step 1: Install NPM (Node Package Manager)</h2>
<p>First  of all, we are going to need Node js. NPM (node package manager, is a part of node js) is a tool for installing 3rd party libraries and dependencies to our project. If you don’t have it yet, you can download and install it <a target="_blank" href="https://nodejs.org/en/">from here</a>. I have also explained it step by step on the tutorial video.</p>
<h2 id="heading-step-2-install-angular-cli"><strong>Step 2: Install Angular CLI</strong></h2>
<p>If you have node js installed, the next step is installing the Angular CLI itself to your computer:</p>
<pre><code class="lang-javascript">npm install -g @angular/cli
</code></pre>
<p><strong>g</strong> stands for <strong>global installation</strong>. If you use -g later you can use the CLI in any Angular project on your computer.</p>
<p><strong>Tip</strong>: Type <code>ng v</code> to your command-line interface (or terminal) to verify your Angular version.</p>
<h2 id="heading-step-3-create-a-new-angular-project">Step 3: Create a new Angular Project</h2>
<p>After the installation is completed, you can use Angular CLI to create a new Angular project with the following command:</p>
<pre><code class="lang-javascript">ng <span class="hljs-keyword">new</span> my-first-app
</code></pre>
<p>This  command creates a new Angular project (named my-first-app, you can use any name) with all the necessary dependencies and files. You don’t have to worry about anything because the CLI does it automatically for you.</p>
<h2 id="heading-step-4-run-the-app">Step 4: Run the App</h2>
<p>After installing the CLI and creating a new Angular app, the final step is to start the project. To do that, we need to use the following command:</p>
<pre><code class="lang-javascript">ng serve -- open
</code></pre>
<p>The “open” flag opens your local browser window automatically.</p>
<p>Angular supports <strong>live server</strong>, so you can see the changes in your local without refreshing your browser’s page. For more details and updates, check also the <a target="_blank" href="https://angular.io/cli">official documentation</a>.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>So in the first part, we’ve made an introduction to Angular, what CLI is and how to install your first Angular app. In the second post, you’re going to learn about <a target="_blank" href="https://www.freecodecamp.org/news/angular-9-for-beginners-components-and-string-interpolation/">Angular Components and String Interpolation</a>. Stay tuned :)</p>
<p><strong>If you want to learn more about Web Development,</strong> <strong>feel free to</strong> <a target="_blank" href="https://www.youtube.com/channel/UC1EgYPCvKCXFn8HlpoJwY3Q"><strong>follow me on Youtube</strong></a><strong>!</strong></p>
<p>Thank you for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
