TypeScript magic school: generics and

TypeScript magic school: generics andtype extensions. 3r33430. 3r3-31. The author of the article, the translation of which we are publishing today, says that TypeScript is simply amazing. When he first started using TS, he terribly liked the freedom that is inherent in this language. The more power a programmer puts into his work with TS-specific mechanisms, the more significant are the benefits he receives. Then he used type annotations only periodically. Sometimes he used the code auto-completion capabilities and compiler hints, but mostly relied only on his own vision of the problems he was solving. 3r3155.  3r33430. 3r3155.  3r33430. Over time...
+ 0 -

Customize a handy npm project for yourself and the team or a little bit about the modern frontend tools

Customize a handy npm project for yourself and the team or a little bit about the modern frontend tools
 
Hello. Recently I got the task to configure the turnover of private npm packages. Everything sounded very interesting and promising until it turned out that there is not much to do there. It would have ended there, but there was a second task - to write a demo repository for the npm package, which could be taken, cloned and based on it quickly create something useful and in the same style.
 
The result was a project with customized formatting, codesteeling, tests for each pool, limits on code coverage, coverage of the code and automatic documentation. Plus a handy publication in npm. Details on the configuration ...
+ 0 -

Angular: Create a multiple checkbox component that is suitable for reusing

Angular: Create a multiple checkbox component that is suitable for reusingLet's create Angular component to create multiple checkboxes from a specific logical group. The component will be written with ideas for reuse. What does it mean? Let's give an example below:
 
 
Imagine before you the task of making user editing. When you edit it, it usually opens a form with all fields. The user can have one or multiple roles from the list Adimin, Director, Professor, Student.
 
 
To implement multiple choice of roles, it was decided to draw on the form one checkbox for each role. Putting a tick or removing the user's role will change.
 
 
To start, let's create a ...
+ 0 -

Angular: ngx-translate. We improve the infrastructure using Webpack

Angular: ngx-translate. We improve the infrastructure using WebpackGood day.
 
It's time to ngx-translate lifhak. Initially, I planned 3 parts, but because the second part is in fact little informative - in this I will try to summarize the 2nd part as briefly as possible.
 
read 1
 
Consider AppTranslateLoader in the replacement of TranslateHttpLoader . Our AppTranslateLoader will primarily pay attention to the language of the browser and contain fallback logic, import the localization of MomentJs, and perform the download via APP_INITIALIZER. As a result of the merger of the two parts of the lifhaks, along the way, we will delve into the ...
+ +1 -

Angular cli 6: what is needed and how to use

Angular cli 6: what is needed and how to use
 
 
Hello!
 
 
The version of Angular ??? was released in September 2016. And immediately appeared a large number of approaches to building and building applications on this framework. On the Internet, you can find the Angular seed for every taste.
 
 
We also created our own Angular seed: we created a common project-template, ordered all the teams developing the front-end to use one application structure.
 
 
And in half a year, in March 201? the version of Angular cli (cli-command-line interface) ??? was released. The idea, taken as a basis, is simply excellent: to systematize the approach to developing ...
+ 0 -

As I migrated the project with Angular 1 on React

Hello!
 
I want to share my experience and tools that I used to migrate the project with Angular 1 on React .
 
TLTR:
I wrote module , with which you can transform the Angular components (controller + template) into React components.
ngReact , but there was no special desire to turn the project into such a monster of Frankenstein. Therefore, it was decided to move the project to React to simplify its development and support.
 
What was
 
The main project is
 
 
The project on Angular ???? angular-ui-router, angular-ui (modal windows, calendars)
 
60/40 - Typescript /ES2015 ...
+ 0 -

Maraquia - ORM for MongoDB

<{full}>
After reading the title, many probably have a question - why another bike if there are already run-in Mongoose, Mongorito, TypeORM, etc.? For the answer it is necessary to understand what is the difference between ORM and ODM. We look at Wikipedia:
 
ORM (English Object-Relational Mapping, Russian object-relational mapping, or transformation) is a programming technology that links databases to the concepts of object-oriented programming languages, creating a "virtual object database".
That is, ORM is just a pro-data representation of data. I recall that in relational databases there is no way ...
+ 0 -

A complete guide to the strategy of detecting changes Angular onPush

A complete guide to the strategy of detecting changes Angular onPush
 
Default strategy for detecting changes
 
By default, Angular uses
ChangeDetectionStrategy.Default
change detection strategy.
 
ChangeDetectionStrategy.Default
works in such a way that every time something changes in our application, as a result of various user events, timers, XHR, promises, etc., detection of changes will be launched across all components.
source code :
 
private _updateLatestValue (async: any, value: Object): void {
if (async === this._obj) {
this._latestValue = value;
this._ref.markForCheck ();
}
}

 

Angular calls markForCheck () ...

+ 0 -

How I started to love Vue

Introduction
 
How I started to love Vue
 
This post is a logical extension of my post /article - How I stopped loving Angular / How I stopped loving Angular .
 
It is recommended to read before reading.
 
For about a year now, in all the projects I'm involved in, I use Vue instead of Angular.
 
In this post, I will share the main impressions and differences after Angular, and also tell some things from the real experience of using Vue on combat projects.
conditioned = pain
 
 
Forms ...
+ 0 -

Angular: ngx-translate lifhaki

Good day.
 
In the near future I plan to publish a little ngx-translate lifhak.
 
 
In the first part zaoverradim TranslateCompiler to teach him how to compile pipes inside our json files. By the way, here is the link for an excellent pluralgender etc. compiler which works with ngx-translate.
 

Our task is to write our TranslateCompiler, which will be able to execute pipes inside ngx-translate localizations.
 
Let's start with the preparation of DI (because we will take the pipes from Injector), and initialize ngx-translate.


 

Add the right pipe in the providers of the ...

+ 0 -