Posts

Angular

Image
                           How an Angular App gets Loaded and   Started   To start an angular app , the app first executes the main.ts file  where it looks for the app.module and in the app module we have the bootstrap array that contains the AppComponent and the appComponent get executes with the html code it has.                                                   Creating a New Component To create a component :    1:     import Component from @anguler/core    2:     create the component imported as a method with @ in the beginning    3:     This component method takes an argument like : selector , template/templateUrl , style/styleUrl.    4: Finally export the c...

sitemap date format

  Date formating in sitemap.xml file for SEO:     The 'lastmod' element has to be of the format YYYY-MM-DD or YYYY-MM-DDThh:mmTZD so use: gmdate( 'Y-m-d' , strtotime($row[ 'modified' ][ 'value' ])) or gmdate( 'Y-m-d\TH:i:s+00:00' , strtotime($row[ 'modified' ][ 'value' ]))

Oop - php

                                                              OOP-PHP      1:config.php     store all the db related info uder this file as constant:      <?php define ( "DB_HOST" , "ecom.loc" ); define ( "DB_USER" , "root" ); define ( "DB_PASS" , "" ); define ( "DB_NAME" , "phptest" ); ? > 2: Database.php create a class with suitable name  and initialize the connection from the database with oop mysqli. and make a function for selecting the data from the database. <?php class Database { //database configuration variables public $host = DB_HOST ; public $user = DB_USER ; public $pass = DB_PASS ; public $dbname = DB_NAME ; //connection and error variables public ...

preparation analytics

                                                            Preparation Test      date : 28/09/2020    CSS :      1: Explain the CSS “box model” and the layout components that it consists of.             Provide some usage examples.      The CSS box model is a rectangular layout paradigm for HTML elements that consists of the following: Content - The content of the box, where text and images appear Padding - A transparent area surrounding the content (i.e., the amount of space between the border and the content) Border - A border surrounding the padding (if any) and content Margin - A transparent area surrounding the border (i.e., the amount of space between the border and any neighboring elements) Each of t...

Working with Express.js

Image
  Whats in the module :         What is Express.js :   Installing Express.js: To install the expressjs into your app , you have to run - npm install --save express Adding Middleware:   example :       const http = require ( 'http' ); const express = require ( 'express' ); const app = express (); app . use (( req , res , next ) => { console . log ( 'In the middleware!' ); next ();//Allow the request  to continue to the next middleware in line }); app . use (( req , res , next ) => { console . log ( 'In another middleware!' ); }) const server = http . createServer ( app )//app is act As a valid request handler. //listening to a port for request server . listen ( 3000 ); console . log ( 'listening to port 3000' );     Handling Different Routes :                           const express = require ( 'ex...