<?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: Paccony</title>
    <description>The latest articles on DEV Community by Paccony (@paccony).</description>
    <link>https://dev.to/paccony</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%2F973243%2Fbcd4223c-92f6-4bf8-b49c-43b5de82545c.jpg</url>
      <title>DEV Community: Paccony</title>
      <link>https://dev.to/paccony</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paccony"/>
    <language>en</language>
    <item>
      <title>Angular Routing in 5 Minutes: A Minimal, Clear Example</title>
      <dc:creator>Paccony</dc:creator>
      <pubDate>Sat, 06 Sep 2025 17:45:07 +0000</pubDate>
      <link>https://dev.to/paccony/angular-routing-in-5-minutes-a-minimal-clear-example-587c</link>
      <guid>https://dev.to/paccony/angular-routing-in-5-minutes-a-minimal-clear-example-587c</guid>
      <description>&lt;p&gt;👋 Hi! I'm Pravoslav Nikolić, learning Angular from scratch. This is my first public tutorial — I hope it helps someone out there.&lt;/p&gt;

&lt;p&gt;When I started learning Angular, routing felt confusing. How do components change without reloading the page? How do I organise multiple views?&lt;/p&gt;

&lt;p&gt;So I built a &lt;strong&gt;minimal, clean demo&lt;/strong&gt; — no extra libraries, no complex logic.&lt;br&gt;
This is perfect if you're just starting and want to see how routing works in practice.&lt;/p&gt;

&lt;p&gt;No APIs, no forms, no state management — just pure routing.&lt;/p&gt;

&lt;p&gt;🛠️ &lt;strong&gt;Step 1: Generate Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the terminal, type in and make the next components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng generate component home
ng generate component about
ng generate component contact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fwadc0vnrfjdy7jqd1g32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fwadc0vnrfjdy7jqd1g32.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each has minimal content — just enough to see the change when navigating.&lt;/p&gt;

&lt;p&gt;📂 &lt;strong&gt;Step 2: Configure Routes&lt;/strong&gt;&lt;br&gt;
In app-routing.module.ts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ts

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { AboutComponent } from './about/about.component';
import { ContactComponent } from './contact/contact.component';

const routes: Routes = [
  { path: '', component: HomeComponent },
  { path: 'about', component: AboutComponent },
  { path: 'contact', component: ContactComponent }
];

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

&lt;/div&gt;



&lt;p&gt;This tells Angular:&lt;/p&gt;

&lt;p&gt;When URL is /, show HomeComponent&lt;br&gt;
When URL is /about, show AboutComponent&lt;br&gt;
And so on.&lt;br&gt;
Result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Frahyllckfxs881omni0m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Frahyllckfxs881omni0m.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🖇️ &lt;strong&gt;Step 3: Add Navigation&lt;/strong&gt;&lt;br&gt;
In app.component.html:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;html

&amp;lt;nav style="background: #1a3c6e; padding: 1rem; text-align: center;"&amp;gt;
  &amp;lt;a 
    routerLink="/" 
    routerLinkActive="active" 
    style="margin: 0 15px; color: white; text-decoration: none; font-weight: 500;"&amp;gt;
    Home
  &amp;lt;/a&amp;gt;
  &amp;lt;a 
    routerLink="/about" 
    routerLinkActive="active" 
    style="margin: 0 15px; color: white; text-decoration: none; font-weight: 500;"&amp;gt;
    About
  &amp;lt;/a&amp;gt;
  &amp;lt;a 
    routerLink="/contact" 
    routerLinkActive="active" 
    style="margin: 0 15px; color: white; text-decoration: none; font-weight: 500;"&amp;gt;
    Contact
  &amp;lt;/a&amp;gt;
&amp;lt;/nav&amp;gt;

&amp;lt;router-outlet&amp;gt;&amp;lt;/router-outlet&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;routerLink handles navigation&lt;br&gt;
router-outlet is where the active component is rendered&lt;/p&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fc7ae4mfr5z81x9m3sn5z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fc7ae4mfr5z81x9m3sn5z.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Step content of pages (minimal but clear)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🏠 home.component.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;div style="text-align: center; padding: 4rem 1rem; background: #f0f8ff;"&amp;gt;
   &amp;lt;h1&amp;gt;Home&amp;lt;/h1&amp;gt;
   &amp;lt;p&amp;gt;This is the home page.&amp;lt;/p&amp;gt;
   &amp;lt;p&amp;gt;Angular routing demo — show content change without refreshing.&amp;lt;/p&amp;gt;
 &amp;lt;/div
&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ℹ️ about.component.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div style="text-align: center; padding: 4rem 1rem; background: #e8f5e8;"&amp;gt;
  &amp;lt;h1&amp;gt;About&amp;lt;/h1&amp;gt;
  &amp;lt;p&amp;gt;Ova stranica demonstrira Angular routing.&amp;lt;/p&amp;gt;
  &amp;lt;p&amp;gt;Klik na link → promjena sadržaja.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📞 contact.component.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div style="text-align: center; padding: 4rem 1rem; background: #fff3e0;"&amp;gt;
  &amp;lt;h1&amp;gt;Contact&amp;lt;/h1&amp;gt;
  &amp;lt;p&amp;gt;Kontakt stranica — treća ruta u aplikaciji.&amp;lt;/p&amp;gt;
  &amp;lt;p&amp;gt;Routing je osnova svakog SPA-a.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🎨Step 5. Styling (in styles.css)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a.active {
  text-decoration: underline;
  font-weight: bold;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the end, you should see.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fz0cciu3ks13p2pqg281c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fz0cciu3ks13p2pqg281c.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Paccony/angular-routing" rel="noopener noreferrer"&gt;github.com/Paccony/angular-routing&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Angular Routing in 5 Minutes: A Minimal, Clear Example</title>
      <dc:creator>Paccony</dc:creator>
      <pubDate>Sat, 06 Sep 2025 17:45:07 +0000</pubDate>
      <link>https://dev.to/paccony/angular-routing-in-5-minutes-a-minimal-clear-example-220o</link>
      <guid>https://dev.to/paccony/angular-routing-in-5-minutes-a-minimal-clear-example-220o</guid>
      <description>&lt;p&gt;No APIs, no forms, no state. Just routing. A clean, step-by-step demo for anyone starting with Angular.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt;In the terminal, type in and make the next components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
**ng generate component home
ng generate component about
ng generate component contact**

Result:
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pv91uv6tzty2ithxe9p1.png)


**2.** Configure app-routing.module.ts
typescript

Result:
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a7zt550gg3e37d7s95ma.png)


`

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { AboutComponent } from './about/about.component';
import { ContactComponent } from './contact/contact.component';

const routes: Routes = [
  { path: '', component: HomeComponent },
  { path: 'about', component: AboutComponent },
  { path: 'contact', component: ContactComponent }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }`


**3.** Add navigation to app.component.html
html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a&gt;&lt;br&gt;
    Home&lt;br&gt;
  &lt;/a&gt;&lt;br&gt;
  &lt;a&gt;&lt;br&gt;
    About&lt;br&gt;
  &lt;/a&gt;&lt;br&gt;
  &lt;a&gt;&lt;br&gt;
    Contact&lt;br&gt;
  &lt;/a&gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
**4.** Content of pages (minimal but clear)
🏠 home.component.html
html

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

&lt;/div&gt;




&lt;br&gt;
   &lt;h1&gt;Home&lt;/h1&gt;
&lt;br&gt;
   &lt;p&gt;This is the home page.&lt;/p&gt;
&lt;br&gt;
   &lt;p&gt;Angular routing demo — show content change without refreshing.&lt;/p&gt;
&lt;br&gt;
 &amp;lt;/div

&lt;blockquote&gt;



&lt;/blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ℹ️ about.component.html
html

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




&lt;h1&gt;About&lt;/h1&gt;
&lt;br&gt;
  &lt;p&gt;Ova stranica demonstrira Angular routing.&lt;/p&gt;
&lt;br&gt;
  &lt;p&gt;Klik na link → promjena sadržaja.&lt;/p&gt;



&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📞 contact.component.html
html

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




&lt;h1&gt;Contact&lt;/h1&gt;
&lt;br&gt;
  &lt;p&gt;Kontakt stranica — treća ruta u aplikaciji.&lt;/p&gt;
&lt;br&gt;
  &lt;p&gt;Routing je osnova svakog SPA-a.&lt;/p&gt;



&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


In the end, you should see.


![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/upyew1fg7y1iwgtvwlx4.png)








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

</description>
    </item>
  </channel>
</rss>
