Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Angular Routing?

I'm new to this topic. In my linuxmint 17, I'm trying to start creating Firebase web app using Angular CLI. It asks me about Angular routing.

What is Angular routing? What do I have to answer?

like image 981
Sopan Dan Santun Avatar asked Mar 03 '19 06:03

Sopan Dan Santun


People also ask

Do I need Angular routing?

At the basic level, routing allows angular to display different "pages" or components. You probably want to have it, if you want to navigate across pages in your application. It shouldn't hurt anything if you add it, but don't use it.

What is routing in Angular interview questions?

Question: How Does Angular Router Work? Answer: Angular router interprets a browser URL as commands to navigate to a client-generated view. The router is bound to the links on a page. This way Angular knows to navigate the application view to the required page when a user clicks on it.

What is default routing in Angular?

Default is "/" (the root path). The path-matching strategy, one of 'prefix' or 'full'. Default is 'prefix'. By default, the router checks URL elements from the left to see if the URL matches a given path and stops when there is a config match.


2 Answers

As they already said, routing enables navigation to different views of your application. It is the main way of taking users to different destinations within the web app. From home page to the contact page, for example, you need a route, meaning a path or a way to take you there.The concept is not particular to Angular. You see this approach in most of the MVC frameworks (ASP.Net, Ruby on Rails, Django, Laravel, etc)

What you should answer. Answer yes. You are starting so it is good because you will have a basic structure to start. As you mature, you will able to set your own routes and manage them using middlewares

like image 82
Abel Chipepe Avatar answered Sep 29 '22 06:09

Abel Chipepe


The Angular Router enables navigation from one view to the next as users perform application tasks.

Check https://angular.io/guide/router for more details about routing in Angular.

If you say "Yes" then CLI will automatically add router configuration to your project.

like image 38
Programmer Avatar answered Sep 29 '22 06:09

Programmer