Hello everyone, with you Maxim Ivanov and Dmitry Sergienkov , and today we will talk about news in the world of Angular. We have prepared for you the most interesting materials and selected a list of questions that you should like. We only note that if you wait for the answer to the question βWhat is Angular Better than Other Technologies?β From this article, you will have to be upset, we will not have an answer to it. Why? As a rule, all opinions of the form "Technology X is better than technology Y" are almost always no more than a reflection of the point of view expressed. However, for those who are just starting to learn this framework, we will try to explain what this technology gives you and what benefits it brings. Also, do not pass by and respond to the survey; the most popular answers will be sent to Igor Minar (the leading developer of the Angular team). Well, let's get started.
Contents :
Angular
1.1. What does Angular give you?
1.2. Angular-RU - Russian-speaking community
1.3. Angular Russia Meetups
1.4. Angular + StackBlitz
1.5. Angular 6: coming soon
Angular digest
2.1. Official resources
2.2. News in twitter
2.3. Communities
2.4. Server rendering
2.5. Cheatsheet (cheat list)
2.6. UI libraries
2.7. Important features
2.8. Angular cli
2.9. Dev tools
2.10. Starter kit
2.11. Webpack starters
2.12. Angular universal
2.13. Publications
2.14. Video lessons
2.15. Style guides
2.16. Angular Connect conference
2.17. Books
2.18. Courses and trainings
2.19. Selection of articles
2.20. Integration
2.21. Component Selection
2.22. Pipe
2.23. Data strictures
2.24. Routing
2.25. Validation
2.26. Logging
2.27. i18n
2.28. Performance
2.29. Lazy loading
2.30. Loaders
2.31. Application examples
2.32. Generators
2.33. Documentation Tools
2.34. TodoMVC
2.35. Extensions for IDE's
2.36. TypeScript
2.37. Dart
2.38. Babel
2.39. ES5
2.40. Ionic
2.41. Meteor
2.42. NativeScript
2.43. React native
2.44. Haxe
2.45. C #
2.46. Java
2.47. Kotlin
2.48. Scala
2.49. Bit
2.50. Security
2.51. Ngrx
Angular is a platform for developing mobile and desktop web applications.
Brad Green (Brad Green, Angular Platform Engineering Director at Google): "By platform, I mean that we created a structure supported by a collection of a huge number of libraries, tools and services that create a complete and scalable development infrastructure."
Brad has been working at Google for almost 12 years, he has worked in many places, but most of all he is proud of the fact that he has worked with Steve Jobs for almost 5 years. Even here, talking about Angular, we can remember the old Jobs and honor his memory.
Angular allows you to create large and complex applications in terms of business logic from the βboxβ. Angular was a complete rethinking of AngularJS, it was probably the most painful, but it was worth it, the framework itself became much cleaner and more flexible, more enterprise-like and, from this point of view, has high scalability.
What advantages can be identified :
To remain honest, it is worth highlighting the disadvantages :
In fact, all these disadvantages are leveled by the developerβs own experience. Everything you need to learn in Angular to develop productive and fast-running applications of any level of complexity is described in the following concepts below:
Form Builder - to develop truly complex forms, you should know the reactive forms , or rather, forget about the declarative forms. Here is one of the good examples (reactive form + validation);
Change Detection - since Angular by default uses two-way data model binding, your applications will run slower when dealing with large amounts of such data, so in some cases you should take care of the correct change detection strategy. You can look at various OpenSource projects: PrimeNG, Angular Material, Clarity UI, Angular Bootstrap and others, they all use ChangeDetection.OnPush.
Templating - the syntax of templates from the point of view of abstraction has not changed too much compared to AngularJS, that is, we can also write conditions, cycles, link a data model, and so on. All that you need to understand well and understand Angular templates is what structural and declarative directives are, as well as Input parameters and Output events.
Routing is probably one of the fundamental phenomena in the development of web applications. Itβs just important to understand that routing, like components, has its own life cycle. By understanding this, you can write really cool applications. It is also worth noting: if you hang a module on any of the routes, and not a component that is responsible for displaying the page along this route, the module will be loaded on the page on demand .
Annotations - by the way, many beginners do not know, but it is worth noting. Decorators, which are used in abundance when writing applications on Angular, are not some kind of rigid TypeScript magic. Decorators are EcmaScript specifications and when browsers start to support them, they will be natively executed in browser runtime. In fact, decorators are very useful and provide quite a high readability of your code. One example is the validation of data models using decorators or the de-serialization / serialization of data.
Observables - in fact, it is worth noting here that soon the Observables will be the EcmaScript specification and all this will be natively supported in browsers. From the point of view of theory, if you expand the concept Observer (observer) - this is a behavioral design pattern. Also known as "subordinates" (Dependents). Creates a mechanism for the class, which allows you to receive an instance of an object of this class from notifying other objects about changes in their state, thereby observing them.
Shadow DOM is a tool for creating a separate DOM tree inside an element that is not visible from the outside without applying special methods. This is the W3C specification. Roughly speaking, this is a convenient way to create isolated and reusable web components. Technically, if browsers already supported many of the concepts that Angular uses, we would not need transpilers and other build systems, everything we wrote on Angular would have worked natively.
Most recently, our community was officially added to angular.io . Now we are trying with all our might to develop it, and you can take part in it. You can join our telegram chat (there you can also find out information about various Angular streams that we have), or simply send us your pull-request (s) or developments and become a member of the Angular-RU developer community.
List of starters :
webpack-angular-starter - simple environment based on webpack + angular
')
webpack-typescript-starter - a simple starter based on Webpack + Typescript
angular-universal-starter - repository with customized Angular Universal
angular-nest-starter - a simple single environment on TypeScript (Angular + Nest)
angular-kendo-ui-starter - repository with customized Angular and Kendo UI
angular-clarity-ui-starter - repository with customized Angular and Clarity UI
angular-ngx-kit - a set of components code generators
angular-ionic-starter - descriptions of the interaction of Angular + Ionic
angular-sws-library-starter - creating and testing Angular libraries
List of npm packages :
Already 2 years in Moscow, held Angular mitapy. This year we plan to hold the first meeting in St. Petersburg (information will soon appear, which you can also follow in the AngularPiter chat). If you have ideas, or you want to make a presentation, you can send your applications. Also, if in your city there are already held mitaps, but we are not aware of this, you can write us an Issue about this, so that we add you.
The most remarkable news worth noting from the Angular team of developers is that they transferred all the working examples in the documentation to the modern online IDE StackBlitz. That is, now your projects that you run locally on yourself are identical to the examples from the documentation.
If earlier they were all on SystemJS and worked in Plunker, now all you have to do is go to the official site of StackBlitz and launch the application on Angular or Ionic with one button. All this works right in the browser, right there you can install npm-packages and write your own code in TypeScript.
But that's not all. The most amazing thing is that now you can run any GitHub repository with Angular-based application directly on StackBlitz.
How it works? You just need to write the following in the address bar:
stackblitz.com/github/{GH_USERNAME}/{REPO_NAME}
or so:
.../github/{GH_USERNAME}/{REPO_NAME}/tree/{TAG|BRANCH|COMMIT}
Now it opens the way to new opportunities and makes it easier for us to collaborate on development. Thank you for the Angular team.
Now we will talk about what awaits us in Angular 6. In fact, there are a lot of things waiting for us, and this is wonderful. Angular 6-beta is already available, and now you can test a new version on some of your applications (as part of this, you can start a new issue on the official angular tracker in case something is not working and you know how to play it ). Many also wonder what the Angular team is busy with, what is their Roadmap? Now you can track it, a special resource hq.angular.io has appeared for us, the teamβs tasks are sorted by priorities.
Most likely, for backward compatibility, we will have to enable the flag in order for our applications to work on the new Ivy render engine. However, it is worth noting that this is fantastic news. Application performance and performance (based on synthetic tests) was better than the latest version of Vue. And the size of the application has decreased by 90%.
Remember that trolling about Angular 2 (when many started to switch from AngularJS to Angular 2), when our applications weighed 1MB and when Webpack 2 fell with incomprehensible errors? These times are almost over. Yes, in fact, Angular 2 was raw at the time, but due to burning deadlines and deadlines, the Angular team released the framework as it is. But now we understand that with each new version it is getting better and better. Of course, our framework does not develop by leaps and bounds, but it is well on its way and for this it is necessary to respect them and put stars on the githaba.
Google is currently working on a new Bazel build system , the build system itself will also be with a built-in compiler for our projects. In fact, when your project grows heavily, (in the case when it consists of 1000 modules, the webpack assembly system starts to slow down very much, and this is noticeable: the webpack just runs out of RAM). Many believe that because of this, the Angular team has still not turned on βaot mode for incremental build. Of course, if you are developing small projects, this is not a problem for you, but, in principle, you can always use anything to build projects (Rollup, Webpack, ..). Angular, of course, does not bind to anything. However, your task is to stick to and live in harmony with the Angular CLI (and then it doesn't matter to you what's under the hood).
Now it is known, according to the statement of the Angular team, that building projects with Bazel takes 2 seconds in an incremental build, and your applications will weigh only a few kilobytes due to the built-in Rollup and Uglify2. But for now it is known (from the latest commits) that we are waiting for the next version of Webpack 4, and the use of Bazel is not yet accurate, and so far only plans.
Why the Angular team came to the conclusion that itβs time to use Bazelβs own build tool and a lot of interesting things you can see here . It describes the complex cases faced by the Angular team, tells about the asymptotic complexity of building large projects and a lot of things in terms of performance.
Angular Elements is a project whose essence is the ability to compile Angular components in Custom Elements. This is one of the long-awaited features that will allow you to write reusable components not only in the Angular ecosystem, but also to use them in projects for React, Vue, Ember, and so on. In fact, the future is for Web-components, due to their native use. This will allow you to basically get rid of the Angular ecosystem (where this is not required).
An example you can see here . The component written on the Angular was compiled, which together with the Angular core in the sum (without additional manipulations of compression, minification, etc.) results in a total of 44kb.
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Ng Elements Test</title> <script type="module" src="/hello-world.js"></script> </head> <body> <hello-world name="World"></hello-world> </body> </html>
There are already a bunch of examples where Angular components are used in React or Preact. But most importantly, it is now possible. However, there is still a lot of work ahead. There are many questions that need to be resolved. In addition about Angular Elements you can read here .
$ ng update
Now you no longer need to worry about updating your application, since starting with Angular CLI 1.7+, the ability to automatically update dependencies will be added, and all the rest will be automatically refactored outdated functionality.
That is, if you previously wrote:
this.http.get(url).map(data => /* do something with data */);
Angular CLI will automatically replace the outdated code with this (most likely again with the flag turned on):
this.http.get(url).pipe( map(data => /* do something with data */) );
This list is good because thanks to it, you will be aware of the main events.
This list is far from complete ...
The component controls how the view is displayed on the screen; it is based on the default Shadow DOM (to create encapsulated visual behavior). As a rule, components are used to create a simple widget in the user interface, while at the same time they can be a set of even simpler components within themselves (to increase abstraction and create simple functional widgets within an application).
@Component({ selector: 'html-name-element' }) export class MyComponent { // ... }
A template is your html markup in which you can describe your interactions with the DOM based on the data model and events of your component class (in the example, the MyComponent controller).
@Component({ templateUrl: './my.component.html' }) export class MyComponent { public title: string = "Hello world"; // .. }
<!-- my.component.html --> <p> : {{ title }}, : {{ this.title }} </p>
Each component has its own change detector, which guarantees checking the data bindings defined by the template.
Dependency injection (eng. Dependency Injection) is a composition of structural design patterns, in which one, conditionally independent object (service) is responsible for each application function, which may have to use other objects (dependencies) known to it by interfaces. Dependencies are transferred (implemented) to the service at the time of its creation.
// logger.service.ts @Injectable() export class LoggerService { // .. public get trace() { return console.debug.bind(console); } }
// my-component.component.ts @Component({ /* .. */ }) export class MyComponent { constructor(private logger: LoggerService) { logger.trace('Init MyComponent'); } }
Directives allow you to directly access the DOM of your elements. They are of two types: structural and attribute.
Attribute directive:
@Directive({ selector: '[bold]' }) export class BoldDirective { constructor(private elementRef: ElementRef){ this.elementRef.nativeElement.style.fontWeight = "bold"; } }
Here the "ElementRef" service is implemented. It represents a link to the element to which the directive will apply:
<!-- my-component.component.html --> <p bold>Hello world</p>
Structural directives:
Structural directives modify the structure of the DOM by adding or removing html elements. There are at least three built-in structure directives: ngIf, ngSwitch and ngFor.
@Component({ /* ... */ }) export class AppComponent { // .. public items = ["Apple iPhone", "Huawei Mate", "Samsung Galaxy"]; }
<!-- my-component.component.html --> <ul> <li *ngFor="let item of items">{{item}}</li> </ul>
Pipe (pipe) is a special handler that allows you to format the displayed values
// my-component.component.ts @Component({ /* .. */ }) export class MyComponent { public fields = [ { id: 1 }, { id: 2 } ]; }
<!-- my-component.component.html --> : <pre> {{ fields | json }} </pre>
In addition to the standard, you can write your own
@Pipe({ name: 'factorial' }) export class FactorialPipe implements PipeTransform { transform(value: number, args?: any): number { if (value <= 0) return 0; let result = 1; for (let i = 1; i <= value; i++) { result = result * i; } return result; } }
// my-component.component.ts @Component({ /* .. */ }) export class MyComponent { public x = 5; }
<!-- my-component.component.html --> {{ x }} {{ x | factorial }} <!-- 5 120 -->
Angular Web Worker support is designed to simplify parallelization in your application. When your application starts up, Angular does all the basic work of processing your logic in separate threads, the kernel performs the calculation in its workflow, while other functions may not be executed in threads.
The most common way to get data from web services is through the HttpClient service available to embed dependencies in your components. Angular HttpClient is pretty simple. All we need to do is call the get method and pass it the url. This get method returns an Observable object. This class is part of the rxjs library, which is used in many places in Angular.
// rest.service.ts @Injectable() export class RestService { constructor(private httpClient: HttpClient) {} public getByObservable(url: string): Observable<any> { return this.httpClient.get(url); } public getByPromise(url: string): Promise<any> { return this.httpClient.get(url).toPromise(); } }
Like a promise (Promise), the observer (Observable) does not immediately contain values. Instead, it has a subscribe method (subscribe), where we can register a callback. This callback is called as soon as the result is available. In addition to the promise, Observable can return more than one value. You can reclaim the flow of results. But it does not matter in this case. In our case, Observable returns only one value.
// my-component.component.ts @Component({ /* .. */ }) export class MyComponent { constructor(private rest: RestService) {} // Observable classic examples public getFields() { this.rest.getByObservable('http://anyurl.com').subscibe(value =>{ // value - }, error => { // error - }); } // Promise classic examples public async getAsyncField() { try { // value - const value = await this.rest.getByPromise('http://anyurl.com'); } catch (error) { // error - } } }
Angular CLI - tool for rapid application development on Angular
Universal (isomorphic) - Angular application rendering on the server side
fullstack.io
Ninja Squad
Manning Publications
Manning Publications
Leanpub
PracticesPackt Publishing
Rangle.io
TrainingIonic Team
Manning Publications
Victor savkin
Angularclass
thoughtram
Hristo Georgiev
Helgevold Consulting
Burak Tasci (fulls1z3)
angular-permission
.TypeScript JavaScript , .
TypeScript JavaScript, JavaScript.
Dart β , Google. Dart / JavaScript. Dart β , , -, .
Babel β JS , ES5.
ECMAScript , ,
angular-es5-starter-kit Angular ES5
Ionic β SDK .
Meteor β - JavaScript, Web- .
iOS, Android JS (TS) + CSS. NativeScript β .
React Native β iOS- Android-.
Haxe β , , , . Haxe , , : , , , (xml, zip). Haxe - API Adobe Flash, C++, PHP . , Haxe, ActionScript 3, JavaScript, Java, C#, C++, Python, Lua, PHP, Apache CGI, Node.js
Scala β , , - . Scala «» Java C#.
C# β - . Microsoft .NET Framework.
Java β - , Sun Microsystems ( Oracle). Java -, , Java-
Kotlin β , JVM JetBrains. JavaScript LLVM.
, , . Bit.
Angular β , , , . , . . , , Issues- , pull-request(). Telegram . Angular, . , , , , . Angular, Angular, Angular. , .
Source: https://habr.com/ru/post/348818/
All Articles