Skip to main content

Posts

Showing posts with the label Angular 5 Constant

Angular Constant & Global Variables | Angular 9, 8, 7, 6, 5, 4, 2

How to CREATE constant in your Angular Apps?   A constant is a value that can’t be changed by the program during normal execution.                                                                  OR Constants are of fixed values that do not change during the execution of a program.  There are various types of constants.  These can be :- 1.       Numeric 2.       Character 3.       Integer 4.       Other types And constant class looks like – export class AppConstants {     public static get baseURL (): string { return "http://localhost:4200/api" ; } } And Use of constant in Services – import { Injectable } from '@angular/core' ; import { HttpCli...