Angular: ViewChild and Local References
Access DOM elements directly using viewChild and Template Reference Variables.
Angular 11 was released on November 2020. As new versions of Angular are released, it is important to keep your projects up to date with latest release. Here are the steps to update to Angular 11:
HttpClientModule
and HttpClient
modules. The HttpModule
and the Http
services have been deprecated.RxJS
to version 6. Then remove rxjs-compat
package.versionedFiles
reference to the files
array.After doing the changes above your project is ready to update to Angular 11. It is important to notice that upgrading multiple Angular versions requires a chain of updates between major versions. Here is the list of changes that needs to be done to update from Angular 7 to 11:
ng update @angular/cli@8 @angular/core@8
Node 10.13
or higher version.ES2015
. If your project requires es5
compatibility, change the target
value of the tsconfig.json
.ViewChild
and ContentChild
are now tied to a static
configuration. This allows control over change detection should run before results are set. The ng update
commands updates them automatically. You should ensure the update script matches your expectations on each case.ng update
commands updates them automatically.ng update @angular/core@9 @angular/cli@9
. The script is going to update files automatically.@angular
dependencies described on your package.json
are pointing to version 9. If any is missing you should perform the update manually.bundleDependencies
enabled by default. If you want to build without bundle dependencies, you need to run the standalone Angular compatibility compiler (ngcc).$localize()
. You can run ng add @angular/localize
to include required packages.ng update @angular/core @angular/cli
command to update to Angular 11. This will migrate your project to latest Angular release.It is important to note that since v10 was announced, the Angular framework does not support IE9, IE10, and IE mobile. The step by step listed above are references on how to migrate to Angular 11. For full details on major changes between each version, refer to the official Angular documentation update.
With the new release of Angular 11 there are key features that have been improved within the framework. Here is a list of changes introduced by Angular 11.
Access DOM elements directly using viewChild and Template Reference Variables.
Steps to compile an Angular application into a single bundle. An overview of the types of Angular compilation bundles and ways to cache bust an Angular application.
Basic overview of the TypeScript and ECMAScript 6 models. An example of use case to exemplify the use of models in external classes.