It always seems impossible until it's done.Namaste developers,
Welcome to my third post on the series of creating a website from scratch. We will be developing front-end and back-end for our Login and Sign-up pages. This login will be user specific, but we may extend its functionality by adding vendor login inside this component which is our future perspective, but should be kept in mind while developing. We need to set up our environment where we will be coding in angular. For this, we will be using Visual Studio Code.
To Setup the environment, follow this blog Guide for Setting up angular link.
After following the above mentioned links, I hope you are all set and ready to start writing your first piece of code.
User Interface for Sign-up:
We will be developing our user interface in Angular. Angular gives us the flexibility to create each of our functionalities as a separate component. This separate component will have its own typescript file and CSS file for providing dynamic as well as user specific style to the component. So, when I work on signup component, I will create sign-up specific styles and variables which will be unknown to other components.Steps to create the UI project
- Open your VS Code and from menu bar > select Terminal > New terminal.
- If not already, install angular CLI using npm install command in your terminal which will appear at the bottom of the VS code UI.
- Create a folder from the terminal using native command: mkdir blogger and then navigate inside that folder using command: cd blogger
- Now that we are inside our working folder, we will create our project using command: ng new BikeRentalUI
- We will be prompted with a question whether we would like to add angular routing?(y/N).Type y to this. Its relevance will be explained in upcoming blogs.
- We will be prompted with another question -> Which stylesheet format would you like to use? Choose SCSS, which is a superset of css with some added functionalities such as variable declaration etc.
- Choose file > Open Folder and navigate to the our blogger folder and open it. The view of the Angular UI after opening the folder would be like the one mentioned in the image below.
- From this view on the left pane, we can see a file named package.json. This file contains the name of all the packages which will be downloaded. We can change the packages according to our requirements. But here we are going to keep it as default.
- To install the packages, type command: npm install
- After all the packages are installed, type command: ng serve -o to run the application on your default browser which would appear something like the image shown below.
Stay Home Stay Safe !






Comments
Post a Comment