Posts

Showing posts from October, 2021

how to call angular function inside document.ready or setTimeout

use arrow function like bellow example myFunction() {      console.log('function called'); } Use like bellow $ ( document ). ready (() => { this . myFunction (); });

How to add common api url link to environment page in angular

step1) add url to your environment.ts.   export const environment = { production: false , apiUrl: 'www.localurl.com' }; step2) add same url to your environment.prod.ts export const environment = { production: true , apiUrl: 'www.productionurl.com' }; Now when you build for production like ng build --env=prod it will automatically use production url and when you build for local use like ng build it will use local url.