Wednesday, 20 May 2020

Angular - CSS style not applying on angular directive

Hello Friends,


In this article, I will explain how to solve CSS style not applying on the angular directive 

In the last week, I was working with one directive where  CSS style was not applying on the angular directive 





Solution 1. Please add /deep/ to your CSS class 

Solution 2 We should use::ng-deep instead of /deep/ which seems to be deprecated.

Usually /deep/ “shadow-piercing” combinator can be used to force a style down to child components. We have another option called::ng-deep.

since /deep/ combinator has been deprecated, it is recommended to use::ng-deep

Please find the below example. This class will be applied to child component


Example
.overview {
    ::ng-deep {
        p {
            &:last-child {
                margin-bottom: 0;
            }
        }
    }
}

Hope this helped you to solve your error
Happy Programming!!
Don’t forget to leave your feedback and comments below!
If you have any query mail me to Sujeet.bhujbal@gmail.com     
Happy programming!!
Don’t forget to leave your feedback and comments below!
Regards
Sujeet Bhujbal
--------------------------------------------------------------------------------
------------------------------------------------------------------------------


Thursday, 23 April 2020

RxJs Pipe Operator


Introduction

RxJS is a framework for reactive programming that makes use of Observables, making it really easy to write asynchronous code.

Sujeet Bhujbal Angular




What is Pipe Operator

RxJS pipe is used to combine functional operators into a chain. 
pipe is an instance method of Observable as well as a standalone RxJS function.
 pipe can be used as Observable.pipe or we can use standalone pipe to combine functional operators.

 pipe accepts operators as arguments such as filtermapmergeScan etc. with comma separated and execute them in a sequence they are passed in as arguments and finally returns Observable instance.

 To get the result we need to subscribe the final Observable response. 


Please find the sample code below



of(1, 2, 3, 4, 5, 6, 7).pipe(
    filter(n => n % 2 === 1),
    map(n => n + 10)
)
.subscribe(result => console.log(result)); 

Output will be 11, 13, 15, 17.




Happy programming!!
Don’t forget to leave your feedback and comments below!



Regards
Sujeet Bhujbal
--------------------------------------------------------------------------------
------------------------------------------------------------------------------




Tuesday, 21 January 2020

Angular - the future of enterprise application development By Sujeet Bhujbal

 What is Enterprise Application 

An enterprise application is a large software system platform designed to operate in a corporate environment such as business or government. An enterprise applications complex, scalable, component-based and distributed.



What is Enterprise Application Development

Enterprise Application Development is a complex process of creating an application for business purposes. They are complex, customized for critical business requirements and can be deployed on the cloud, on a variety of platforms across corporate networks, intranet, etc. Designing and developing such enterprise applications means satisfying hundreds or thousands of separate requirements.

Common uses for enterprise software include:
  • Order processing
  • Procurement
  • Scheduling
  • Customer information management
  • Energy management
  • Accounting




Changing Trends in Enterprise Application Development

1.User Experience
       Users expect their apps to be more easy to use and understandable

2.Full Stack Development:
                    Use of modern client-side frameworks and server-side technologies\

3.API-led Integration:
                 Providing REST API based integration approach such that application can easily integrate into an internal, external as well as  Cloud-based service. This allows for faster, easier development.

 4. Rapid Application Delivery & Low-code Development
                      Rapid Application Delivery & Low code development is the new trend in Enterprise. Minimal Coding is making Enterprise Application Development more business-centric and easy. Customers are involved in each phase of development

5. Loose Coupling (APIs, Microservices, Composable architecture)–
           Loose Coupling and microservices enterprise applications are delivered as an independent runtime service with a well-defined API. The Microservices approach allows faster delivery of smaller incremental changes to an application.
6.Ready-made Application Infrastructure
                  Need readymade application infrastructure and framework

Angular  - the ideal enterprise application development framework

 Angular is used for rapid application development and delivery platform that helps create enterprise-grade web and mobile apps. With over 10 years of market presence, thousands of developers use it to create applications 67% faster.
The angular platform builds, deliver and manages modern custom applications, improves business agility and applies innovation. The Angular framework leverages the latest trends and technologies in Rapid App Development (RAD) such as multi-device auto-responsive interfaces and componentized app assembly,

Angular is achieving global success in enterprises, with a few of which are briefly described below:
•           American Express, Dell, Marriott, Wal-Mart and many Fortune 500 companies are using Angular as their front-end development framework today.
•           Amazon, Google, YouTube, Nike, and Virgin America and many others are actively using Angular for their projects.
•            Google’s Angular framework is making it possible for enterprise apps to support browser-side rules processing and multiple larger catalogs, streamlining complex customer, order management, and pricing workflows

Below are the advantages of Angular for enterprise application

1.Small and Fast application development
Enterprise solutions run on multiple components built by multiple teams. This puts extra pressure on developers in terms of scaling and actualization. A modern web application has to be sensitive for the reaction from users and deliver impeccable performance because there are no second chances. Small and fast app development is one of the core focus areas of Angular today. The recent release of Angular 2.0, a complete re-write of the development framework from 1.0 to take full advantage of modern web and native mobile platforms, including greater modularity, support for modern browsers, TypeScript support in addition to several other feature areas.
Also in the latest angular 8.0 version, they introduced the new IVY framework which will reduce all the project size in KBS.
Angular application development can increase speed and reduce codebase size
Angular team has committed to ensuring stability and a smooth forward transition between releases. The team is also heavily invested in providing tools to empower developers to seamlessly upgrade between versions in an automated way.  

2. Typescript
TypeScripthas proved beneficial in gaining enterprise adoption and improving security.   TypeScript addresses enterprise needs in a few ways including integration with Microsoft's development stack (Visual Studio, VS Code, Office development)
also as a language itself as TypeScript helps bridge the knowledge gap for server-side developers moving from .NET to Javascript. In typescript finding bugs faster in their code, refactoring and readability can accelerate development.

3, Building Mobile Application easier
 Angular is used for mainstream Google apps including AdWords, AdSense, API Explorer, and others A broad spectrum of Google customers are developing mobile apps using Angular including LucidChart
Angular is designed specifically with mobile app development in mind.

4. Customer Experience
 The biggest advantage of Angular and other open-source frameworks is the ability to tailor the user experience in an enterprise app quickly and have that change reflect across all Web-enabled platforms. This alone saves thousands of hours of programming, testing and validation time. . Angular is proving to be superior at templating and localization compared to legacy programming languages.
 Analytics, BI and e-Commerce apps often rely on large-scale data sets to fulfill queries and complete workflows. By providing backend support vias APIs to large-scale datasets, Angular is enabling all workflows designed into the app to be available on any platform anytime.



Sujeet Bhujbal Angular


Angular UI Component for Enterprise Application


1.Telerik Kendo UI for Angular
                      This one was almost the most obvious and natural choice, as we were already using Kendo components.

2. Angular Material
If you need Table component with built-in individual column filtering and row details, sticky/stacked columns, built-in grouping, etc. — you might want to consider other option, or, at least, test MatTable component on some real-world test case

3. Vmware Clarity
Project Clarity is an open-source design system that brings together UX guidelines, an HTML/CSS framework, and Angular components. Clarity is for both designers and developers.

In this way, Angular is best for Enterprise level applications.

Happy programming!!
Don’t forget to leave your feedback and comments below!

Wednesday, 15 May 2019

.map(), .reduce(), and .filter() in Javascript

Introduction
 .map(), .reduce(), and .filter() are new features in Javascript. In this article i will tell you example of  .map(), .reduce(), and .filter() function,
Sujeet Bhujbal Javascript





What is .map()

The Map object holds key-value pairs and remembers the original insertion order of the keys.Any value  may be used as either a key or a value.

Map object iterates its elements in insertion order — a for loop returns an array of [key, value] for each iteration.

The map() method creates a new array with the results of calling a function for every array element.
The map() method calls the provided function once for each element in an array, in order

Example : 


If you want ids of all employees There are multiple ways to achieve this. You might want to do it by creating an empty array, then using .forEach().for(...of), or a simple .for() to meet your goal.



var Employees = [
  { id: 20, name: 'Sujeet' },
  { id: 24, name: 'Rahul' },
  { id: 56, name: 'Raj' },
  { id: 88, name: 'ASSHAY' }
];

const empIds = Employees.map(emp => emp.id);

console.log(empIds)

OutPut

(4) [20, 24, 56, 88]



What is .Reduce()

 

The reduce() method reduces the array to a single value. The reduce() method executes a provided function for each value of the array (from left-to-right). The return value of the function is stored in an accumulator (result/total).

The reduce() method reduces the array to a single value.
The reduce() method executes a provided function for each value of the array (from left-to-right).
The return value of the function is stored in an accumulator (result/total).

Example


   var employees = [
  {
    id: 10,
    name: "Sujeet",
    years: 10,
  },
  {
    id: 2,
    name: "Rahul",
    years: 3,
  },
  {
    id: 41,
    name: "Ramesh",
    years: 1,
  },
  {
    id: 99,
    name: "Sumit",
    years: 12,
  }
];

const totalYears = employees.reduce((acc, emp) => acc + emp.years, 0);

console.log(totalYears)

OutPut : 26



Waht is .filter()


if you have an array but want some of the elements in it. You can use .filter() here

   var employees = [

  {
    id: 10,
    name: "Sujeet",
    years: 10,
  },
  {
    id: 2,
    name: "Rahul",
    years: 3,
  },
  {
    id: 41,
    name: "Ramesh",
    years: 1,
  },
  {
    id: 99,
    name: "Sumit",
    years: 12,
  }
];

c      const emp = employees.filter(emps => emps.name === "Sujeet");
        console.log(empDetails)


   OutPut

   
  1. [{…}]
    1. length1




Happy programming!!
Don’t forget to leave your feedback and comments below!


Regards
Sujeet Bhujbal
--------------------------------------------------------------------------------
------------------------------------------------------------------------------