Skip to main content

Posts

Everything You Need to Know About HTTP in Angular and Making HTTP Request in Angular

  Before we start sending requests, it's important to understand the anatomy of an HTTP request because a HTTP request is made up of a couple of core parts which we'll all have a look at in this module here when it comes to configuring them when sending a request. The most important part about a request of course is the URL you are sending the request to, that's also called the API endpoint and it is something like yourdomain.com/posts/1 for example, the exact path here of course depends on the API you're interacting with. However, when communicating with a RESTful API, it's not just about the URL but also about the HTTP verb you're using, something like post, get, put. This defines which kind of request you want to send to that endpoint, do you want to store a new data? Do you want to fetch data? Do you want to replace existing data? The HTTP verb makes that clear but it always depends on the API you're working with, which endpoints and which verbs for thes
Recent posts

How to Install Apache 2 on Linux 2 for Angular Application and How to fix 404 Error in Angular App

  Step 1: Launch an EC2 Instance(Linux 2) Before we install apache web server on the EC2 instance, we will need an EC2 instance up and running. You can refer my previous tutorial to launch a Linux 2 instance in AWS. Link to tutorial:   How to Launch EC2 Instance Step by Step in AWS Step 2: Connect to your Linux 2 instance Once your instance is up and running, you need to connect to your instance. I will be using EC2 instance connect feature for this as it allows to SSH into instance from browser itself. However, if you want to usual SSH, feel free to use below command from your terminal. ssh - i / path / my - key - pair . pem ec2 - user@instance - public - ip To SSH from browser using Instance connect, follow below steps. Select your instance and click connect   as highlighted below 2.  Once, you click Connect, you will see a screen with default username for a Linux 2 instance verify that  ec2-user  is showing in username field and click  Connect . A new browser window will open and yo

Everything You need to About Angular Template Driven Forms

 Forms in Angular  Forms on html page and how angular can help you with those forms now on first side might be strange because form is something that you can simply submit server then keep in mind you are creating a single page application so there is no submit to the server instead you have to handle from through angular and if then you want to submit  something to server you will need to reach out via angular http  service. How angular works together with forms. This is html code of form which you might use nothing is angular specific about this code its normal html code placed in html document it will be displayed like this with the input for Name and mail     Now angular job now is to allow you to retrieve values which is entered here and also check some other things like  is the form valid did the user entered valid information all that will happen in javascript and in typescript or we can say angular side. So some how we have to pass these values which user enters so some how you