Angular Basic Routing

First Create a folder and name it, name it whatever you like but for me I name it SIA-ANGULAR and then I opened the terminal and type ng new Angular-Basic-Routing this is just a name you can name. and I put a flag no stand alone because modern angular are usually standalone so you wont have a app.module you will need to set it up manually so to save some time I just put a no standalone flag.

And then It will ask you these question just choose CSS and then NO and it will install all the packages and dependencies just wait for it to finish then enter the path by typing “cd (and your file name)” and run it using “ng serve”, anyway I already installed the angular globally that’s why i didn’t have to type install command for angular.

Now, I will create a github repository named “AngularBasicRouting” this is where I am going to store all my codes by simpling pushing it inside this repo.

Back to vscode, Inside the app folder I created another folder named “components” this is where I will store all the generated new components.

Right click the component and then open in integrated terminal because we will generate components there.

then in the terminal to generate components just type “ng generate component [component name]” or you can simple type “ng g c [component name]” for shortcut it will do the same.

As you can see I have the app.module and app.routing module already its because of the flag I awhile ago the “—no-standalone” it saves me time all i need to do right now is to connect them, it imports automatically as well.

now after we’re done with the set up and importing and connecting the links, this is how you connect the links this are the codes and the output is at the bottom.

note: I didn’t notice it I forgot to change the landing page name into “landing page” the name is still written as sign up.

Here I changed it into landing page, now im done and all set the next step is pushing it to the repository that I’ve created.

First open the terminal again, type “git init” to initialize the folder that you are using and then you can type “ git add .” I just type “git status” to double check it.

and this is the next command after we add the file lets save it by using commit command and then add some message and after that using the remote add we can specify what github repository we will use buy adding the like of that specific repo. and then choose a branch. this branch is important especially if we are collaborating with other programmers and then lastly push it to the repository

if you can’t find the link you can find it in the repository

Here.

And this is the file being pushed in the repo.

This is the files insde.

NOTE: I CHANGE THE GITHUB REPOSITORY. FROM BasicAngularRouting to BasicAngular-Routing I made a mistake on the process of opening the terminal, but still the process are the same the commands are the same.

This is the commands, its still the same.

GITHUB LINK: https://github.com/thisisnotsnorlax/BasicAngular-Routing.git