Skip to main content

Posts

What are the differences between Angular Js, Angular 2 and Angular 4?

 Angular Js was introduced in 2010 as a javascript framework for building client applications So it came into popularity. And angular team started adding new features to the core. But the framework is designed with needs up to date applications in might plus it was overly complex. So, the Angular team decided to write the original framework using typescript. As a result, Angular 2 came out in may 2016.     This new version entirely different from angular 1. This made a lot of developers unhappy 😕.  Because numerous applications built with Angular 1. Each application over a few thousand lines of code has to be written. So Angular Team took typescript. Now, this is a much better framework and it is easier & very clear to understand to work with.  After a few minor upgrades in Angular 2 such as 2.1, 2.2, and 2.3, a sudden update came into existence i.e Angular 4.Again all developers got confused 😞 including me. Then what happened to Angular 3 😨. We thought we missed out somethin

AngularJS - Directives

First, we have to learn AngularJs directives, Directives are simple special attributes in HTML. It has own set of built-in directives which offers functionality to your applications. To check all directive list https://docs.angularjs.org/api/ng/directive  For example, I take ng-app , ng-model ,  ng-init and ng-bind .  First will talk about the ng-app directive, the ng-app directive is initializing the AngularJS application. To take the values of all HTML inputs ( input, radio, select and textarea ) we use the ng-model.     ng-bind is print the expression. we can also be written inside double braces: {{ expression }} . AngularJS - Directives Example 1  Note: All these directives are work in inside the ng-app closed tag. you can assign ng-app directive to any tag. like <HTML>, <DIV>, <SPAN> but make sure initialize the main parent tag.     Now, We can check data initializes before page load. For this, we can use the directive ng-init . The

What is AngularJS?

AngularJs is nothing but an MVC style javascript framework for creating single page apps. It is a javascript framework or we can say  "A framework will build client applications in HTML, CSS and Javascript/Typescript" This should be added within HTML  <script> tag. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.min.js"></script> Angular Js mainly used to make a single page, data-driven application. As well as we can add additional content brought into the web page without the need to refresh. Before going to AngularJS, We should know the     HTML     CSS     JavaScript     Json (optional)  Benefits of using angular Js     Gives our applications a clean structure     Includes a lot of re-usable code     Makes our applications more testable      Using Angular makes your life easier!   Let's Start learning with deep examples, you can download the latest version in https://angularjs.org/

D3 tree chart

D3.js is a JavaScript library for controlling records in view of information. D3 encourages you to breathe life into information utilizing HTML, SVG, and CSS. D3's accentuation on web principles gives you the full capacities of present-day programs without binds yourself to a restrictive structure, consolidating ground-breaking representation parts and an information-driven way to deal with DOM control. Here I'm going to show of D3 Tree chart. D3 Tree chart helps you go in-depth of child roots. DEMO Download <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS Bin</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="//d3js.org/d3.v3.min.js"></script> <style> .node { cursor: pointer; } .overlay{

IST to EST time conversion in PHP

IST to EST time conversion  using PHP <?php $dt = new DateTime('2011-02-22 16:15:20', new DateTimeZone('Asia/Kolkata')); echo $dt->format('r') . PHP_EOL; $dt->setTimezone(new DateTimeZone('US/Eastern')); echo $dt->format('r') . PHP_EOL; //Second example $time = new DateTime('now', new DateTimeZone('UTC')); // then convert it to IST by $time->setTimezone(new DateTimeZone('IST')); echo $dt->format('r'); ?>