Skip to main content

Posts

How to call API in angular & with an example of PHP API

How to call API in angular & with an example of PHP API . Software required:- Node ->  https://nodejs.org/en/download/ VS Code ->  https://code.visualstudio.com/download Angular CLI -> npm install - g @angular / cli To understand how to call API in angular follow the below steps:- Step:1 Project Setup 1. Create a project in angular ->  ng new project name 2. Install npm -> npm i 3. Import HttpClientModule in app.module.ts -> import { HttpClientModule } from '@angular/common/http' ; 4. Add provider providers : [ WebserviceService ], example -> ng new crudInAngularPHP Step:2 API Service 1. Create a service with name webservice -> ng g s services/webservice 2. import modules import { HttpClient, HttpHeaders, HttpRequest, HttpEvent } from '@angular/common/http'; 3 .    C all constructor  constructor( private http: HttpClient) 4. Add a common function to get a response of API with name postRequest:-      ...

How and When to Write Comments in Javascript?

Watch here:  https://youtu.be/63fHgi2lvc0 Introduction   Programming languages offer the option of leaving notes for yourself or others. The JavaScript comment feature simplifies the production of more readable code. They are easy to write and recognize. In programming, our first consideration is usually the machine — how the computer is reading and interpreting the code we write. However, it’s equally important to consider the people who will be reading and working with the code. Whether you’re working with a team or on your own, you will need to learn to properly comment and structure your code for human readers. Comments are annotations in the source code of a program that are ignored by the interpreter, and therefore have no effect on the actual output of the code. Comments can be immensely helpful in explaining the intent of what your code is or should be doing. As a developer, it can be frustrating to delve into code written by someone else that was not properly commente...

How to check if JavaScript is enabled and Use of NAVIGATOR Object in javascript

  Episode#3 Topics:- Why NoScript tag important? How to use this tag?  What is a navigator in javascript? How to use this? Example to know browser properties. Example to know flash player installed or not in your system. Example to know your location in javascript. Watch Here:  https://youtu.be/IzWfdmJ5hpw If u r making a website with the help of javascript, u must use  < noscript > </ noscript > Why it's important to use the NoScript tag by developers? Website users will not be allowed to use features made by JS code. It may decrease no of users on your website It may prevent you from attack. like you made a form where all validations added/written in javascript. so in this case your validation will fail. Navigator object:-  Navigator in  JavaScript is an object  that provides details about the browser that the user uses to access the web application. As we have Document Object Model (DOM) to have control over manipulating the data, ...