Split module into single component angular modules (SCAMs)

Loading

Reading Time: 6 minutes Introduction When Angular application grows, developers start to build new components and add them into modules. When we put every component into a single module, not only the module becomes bloated but also cannot identify related resources (components, pipes, directives, etc) that can bundle together. In order to avoid bloated module in an Angular application, … Read more

Functional composition with compose and pipe in lodash/fp

Loading

Reading Time: 3 minutes What is functional composition? Functional composition is the technique of composing multiple functions into a complex function. In Mathematic definition, f(x) and g(x) are functions and h(x) is the composed function of f and g. Functional composition is an efficient technique in processing list data and it is preferred over calling chained array methods to … Read more

Customize template with ngTemplateOutlet and ngTemplate in Angular

Loading

Reading Time: 4 minutes Introduction When Angular components require to render ngTemplates programmatically, ngif-then-else construct takes care of most of the scenarios. However, ngIf is lack of passing context that ngTemplateOutlet directive supports. If either template depends on inputs or calculated data of component, then we can pass the values to them via template context of ngTemplateOutlet directive. The … Read more