Skip to main content

AngularJs/javascript and Angular/typescript (version 2/4/latest) have a series of difference.

   

                     AngularJs vs Angular (Typescript)

                                               On basis of process of compilation
         ANGULARJS :
  • Angular Js compiler traverses the DOM looking for attributes.It takes two phase for compilation where initial phase traverse the DOM and collect all of the directives. The result is a linking function.
  •  Next phase evolves combine the directives with a scope and produce a live view. Any changes in the scope model are reflected in the view, and any user interactions with the view are reflected in the scope model. This makes the scope model the single source of truth.
  • Angular/Typescript:An Angular application consists multiple component alongwith HTML directives. Before the browser can render the application, the components and templates must be converted to executable JavaScript by an Angular compiler.Angular offers two ways to compile your application:
  • Just-in-Time (JIT), which compiles your app in the browser at runtime
  • Ahead-of-Time (AOT), which compiles your app at build time.       
                                                                          On basis of code syntax:
In case of angularJs the javascript function written for controller can be viewed as
while similar functionality if handled in angular/typescript the length of code might take some extra line.But the selector in the given below lines of code makes a big change.In case of every selector can be use as html directive
                       
View of this component along with html,css & controller part  as file.ts  can be used anywhere.





Comments

Post a Comment

Popular posts from this blog

Difference between String ,StringBuffer & StringBuilder?

Run this simple java program and create scenerio of String object creation in your mind.You will see huge difference than expectation.                                I would recommend to first try on your own then follow the solution . As you execute the above line of codes in your Java Runtime Environment .As compiler read the lines .In  case of                                      String a= new String("Hello");        As it will allow compiler to create a new string object .It is always mandatory for  compiler to allocate a memory space in heap whenever new  keyword is used.So String class object created successfully in heap with reference variable a.And a very important point  need to be noted down that here  "new String("Hello');"  ...

DS PROBLEM :Find a pair with given sum in a BST(Binary Search Tree)

Problem :  Given a Balanced Binary Search Tree and a target sum, write a function that returns true if there is a pair with sum equals to target sum, otherwise return false. Expected time complexity is O(n) and only O(Logn) extra space can be used. Any modification to Binary Search Tree is not allowed. Note that height of a Balanced BST is always O(Logn). Solution: There are two approaches to solve the problem The  Brute Force Solution  is to consider each pair in BST and check whether the sum equals to X. The time complexity of this solution will be O(n^2).

Before Starting MicroServices just walk through Orchestration !! Matters a lot

What is this Orchestration : Orchestration is the traditional way of handling interactions between different services in Service-Oriented Architecture (SOA). With orchestration process, there is typically one controller that acts as the “orchestrator” of the overall service interactions. This typically follows a request/response type pattern. For example, if three services needed to be called in a particular order, the orchestrator makes a call to each one, waiting for a response before calling the next.