Thursday, 29 August 2019

what is angular 8 and New Features?

what is angular 8 


 Angular is the most popular developing platform for client-side (front-end) mobile and desktop web applications.web applications are simply dynamic websites
  • Time-to-time (eg. news update webs applications)
  • Location-to-location (eg. Weather-report web applications)
  • User-to-user (eg. Gmail, Facebook-type applications)

What’s new in Angular v8?

As planned, there were no shocks: the update of the structure and CLI can be done by working ng update and the new features are a welcome increase in line with the saw “evolution instead of revolution”.

In this post, I will cover the most relevant new features of Angular 8 and the identical Angular CLI 8. The examples I will use can be located on GitHub.

First glimpse of Ivy

The next important news the Angular world is helping is Ivy, which is the latest Angular compiler as well as a new rendering pipeline. Ivy has the potential to create considerably fewer bundles, it executes incremental compiling easier and is also the source for future changes in the Angular field.

After many underlying components of Angular have been changed here, the Angular team must pay specific notice to unity with preceding Angular versions: after changing to Ivy, current applications should work just as previously. In the best example, noticeably fewer bundles should satisfy. That is not selfless, as more than 600 applications at Google are authorized based on Angular – the real number, according to reports, is much higher

  Update Angular CLI previous versions to Angular CLI 8

 we are defining how to update your previous version of Angular in the latest version.you can quickly update it to Angular 8 by doing the following things:

  Step 1: Initial, review your current version of Angular CLI by applying the following command.  
   
ng -version  

  Step 2: Run the next command to uninstall your older version of Angular.

  For Windows
  npm uninstall -g angular-cli 

   For Mac

  sudo npm uninstall -g angular-cli 

Step 3: Currently you have got to verify and clear the cache by using the following commands.
  npm cache verify npm cache clean

  Step 4: Install the latest Angular CLI (Angular 8) by using the following command.        npm install -g @angular/cli@latest

  Step 5: Angular8 CLI is installed. You can verify it by following the command.
  ng --version 

  Update Angular Packages

If you have got generated your project in any other Angular version then move inside that folder and use the following command to update that package.    

ng update @angular/core   




1). Differential loading-

Differential loading is a new feature that allows you to use version 8 of the Angular CLI to generate 2 different production packages of your app. Attributes on the <script> tag in your index.html file made the browser offer the various proper bundle; new browsers will request a bundle that does ES2015 JavaScript syntax and will be significantly smaller than the legacy package that applies ES5 syntax to keep support for earlier browsers. Differential loading is allowed by default for new apps generated with version 8 of the CLI, but you can simply allow this feature on your current apps by updating to Angular 8, joining a browser list shapefile, and setting the “target” option in your tsconfig.json file to “es2015”. The result?  Your users with new browsers get a smaller bundle that loads faster (and puts a bigger smirk on their profile).

2). Current lazy loading syntax

Lazy loading feature modules has been a most useful application in Angular for quite a while. That hasn’t improved in version 8, but in the position of the exclusive syntax to allow lazy loading, the framework has used the more traditional dynamic import syntax applied extensively in client-side web development. The new syntax relies less on parsing class names from strings and allows editors and IDEs to verify that you’re importing the right things.

3. Create web workers with the CLI

Angular 8 makes it easier than ever to use web workers to handle CPU-intensive tasks in your apps. Version 8 of the Angular CLI includes a new schematic used with the ng generate the command to generate and update the required files in your project to add a modern web worker. The new and refreshed files include a basic template for your new web worker so you can fret short about boilerplate syntax and more immediate focus on writing the code you want to run on a background thread.

4. Builder and workspace APIs

Although all apparently not a feature you’ll utilize on each project, Angular 8 also introduces different APIs that enable you to generate a custom build and deployment commands applying hooks into the simple ng build, ng test, and ng run commands. There are also unique APIs that enable you to start and work with the workspace established in your angular.json file, which should decrease the amount of manual administration required to correctly configure your project.

5. A new guide for old features

The Angular team added a new deprecation guide with Angular 8 to get it more accessible for developers to maintain track of deprecated features and APIs. The production of this guide should not be misconstrued as a sign that deprecations will be sprung on the developer understanding with limited time for remediation. In detail, the Angular company is committed to helping articles for two important comments after regularly being deprecated. The resulting trust in the framework linked with the helpful deprecation guide should ease the transition continuously from those older features.

Tuesday, 30 April 2019

Google Analytics API: “User does not have sufficient permissions for this account.”



After googling i do not perceive that i cant get ga:users with Oauth2 access_token / refresh_token...why i have to add a region to service@email in my google analytics settings?
For example our service implement options for investigation e-commerce, additionally we tend to should show single guests.

so we tend to cant get ga: users if the user simply permit access by oauth2 to their account with scope 'email,profile,analytics.readonly' ?

Google Analytics API: “User doesn't have enough permissions for this account.” in Php 
Solution

Solution : 

Make sure you give the service account email (something like piyush@developer.gserviceaccount.com) permissions to read/write from your GA view. Admin > View > User Management > "Add permissions for:"



Tuesday, 5 March 2019

How to install ng-bootstrap in angular 7


This repository contains a set of native Angular directives based on Bootstrap and CSS. As a result, no dependency on jQuery or Bootstrap's JavaScript is required.
Here is a list of minimally required versions of Angular and Bootstrap CSS for ng-bootstrap:

Wednesday, 28 November 2018

How to use directive in angular 7


                                              (Angular Directive Example)

 Angular Directive may be a category with a @Directive decorator. Decorators are the functions that modify JavaScript categories. The decorators' are used for attaching data to categories because it is aware of the configuration of these categories and the way they must work. you'll be shocked to grasp that the part is additionally a directive-with-a-template. The @Component decorator may be a @Directive decorator extended with template-oriented options.

Monday, 26 November 2018

How to use router in angular 7



In my previous post, I mentioned application structure victimization Angular modules, and established the groundwork for victimization core, shared and have modules. during this post, I'll demonstrate a way to setup basic routing in associate Angular application victimization Angular Router Modules.

Wednesday, 21 November 2018

How TO Install Angular 7 With Bootstrap 4 ?


Install or update to Angular user interface v7

For this tutorial you wish to upgrade Angular user interface to version 7+ if you haven’t done therefore already. to try to, therefore, you'll use this command:

npm install -g @angular/cli@latest


 create project by cli ng new angular 7




To verify you're on the correct version, run nanogram --version and verify that the output is comparable to this:

Friday, 16 November 2018

All New Features Of Angular 7.0

               All Top 10 Features introduced in Angular 7.0






Angular is one in all the leading common frameworks for internet application development. With the release of Angular seven, it's given even a lot of options to internet developers like as well as the core framework, Angular Material, user interface with synchronized important versions, with the toolchain, and has allowed many important partner launches.

So we manage to ar lightness a number of its new options declared by the Angular Team. however not lots of recent options & updates introduced through this unharness, Angular seven in the main concentrated on the Hedera helix project, redaction the Angular compiler and runtime code to create it less, better, faster. however, Hedera helix isn't made for clock time nonetheless.

CLI Prompts:


The angular user interface has renewed to v7.0.2 intercalary some options like currently, it'll inspire users whereas writing common commands like ng-add or ng-new, @angular/material to help you to create intrinsical options like routing or SCSS support. With Angular seven, whereas making new comes it takes advantage of Bundle Resources in the user interface.


Application performance:


Angular team discovered blemish that Angular developer was as well as the reflect-metadata polyfill in production, that is simply required in development, so as to mend this, a part of the update to v7 can mechanically take away it from your polyfills.ts file, and so embrace it as a build step once building your application in JIT mode, removing this polyfill from production builds by default.
To speed up the performance new applications can warn once the initial bundle is quite 2MB and {can} error at 5MB that user can modify it in angular.json file. These budgets align with warnings which will be shown to users taking advantage of Chrome’s information Saver options.

Angular Material & the CDK



Angular Material and also the part Dev Kit (CDK), Angular seven options visual enhancements in Material style that received a significant update in 2018, refresh similarly as virtual scrolling, for dynamically loading and unloading elements of the DOM to make high-performing, massive lists of information. Also, applications may be fitted with a drag-and-drop capability by importation the DragDropModule or the ScrollingModule.


Virtual Scrolling :






The scrolling package  provides helpers for directives that react to scroll events. Virtual Scrolling allows loading and unloading components from the DOM supported the visible components. It allows a performant thanks to simulate all things being rendered by creating the peak of the instrumentation component an equivalent because the height of a complete range of components to be rendered, then solely rendering the things visible  makes in no time experiences for users with terribly massive scrollable lists.

Drag and Drop :-



The @angular/cdk/drag-drop module provides you with some way to simply and declaratively produce drag-and-drop interfaces, with support at no cost dragging, sorting at intervals an inventory, transferring things between lists, animations, bit devices, custom drag handles, previews, and placeholders, additionally helper ways for rearrangement lists (moveItemInArray) and transferring things between lists (transferArrayItem).

Angular Compatibility Compiler (ngcc)


Just like the name suggests, this compiler are accustomed rework the node_modules compiled with the ngc to node_modules that square measure compatible with the new Hedera helix renderer. Angular Compatibility compiler converts node_moduls compiled with ngc, into node_modules that seem to own been compiled with ngtsc. This conversion can enable such “legacy” packages to be utilized by the Hedera helix rendering engine.

Angular Do-Bootstrap

It's used for bootstrapping modules that require to bootstrap a part. Angular seven else a brand new life-cycle hook (ngDoBootstrap) and interface (DoBootstrap).
For example

Better Error Handling
Angular seven has Associate in Nursing improved error handling for @Output if property isn't initialized
Dependency Updates In Angular seven

TypeScript three.1 support
Angular seven have updated matter version from two.7 to 3.1 that is it is the latest unharness. It's obligatory to use TypeScript's latest version whereas operating with Angular seven. sometimes Angular lags a couple of releases behind, in order that they have done that to match latest matter version for once.
RxJS 6.3
The latest version of RxJs(version half-dozen.3.3) is further in Angular seven with it new exciting additions and changes. These changes offer developers a lift in performance and easier to rectify decision stacks and improvement in modularity conjointly creating it as backward compatible as doable.
Added Support for Node v10
Team Angular seven currently support the Node V10 with backward compatibility likewise, check up on what is new in Node v10.
Angular parts with Slot


Angular 6.1 permits the feature of ViewEncapsulation.ShadowDom, that is nice for Angular parts that currently supports content projection exploitation net standards for custom parts. a brand new commonplace markup language part, introduced by the net element Specification that is slot. This feature is currently on the market, enabling  parts with a templet.