AngularJS 1.x has ngCloak directive, which is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form.
Does Angular 2 have any such directive or functionality to prevent such raw(uncompiled) form display.
Definition and Usage The ng-cloak directive prevents the document from showing unfinished AngularJS code while AngularJS is being loaded. AngularJS applications can make HTML documents flicker when the application is being loaded, showing the AngularJS code for a second, before all code are executed.
The ng-include directive includes HTML from an external file. The included content will be included as childnodes of the specified element. The value of the ng-include attribute can also be an expression, returning a filename. By default, the included file must be located on the same domain as the document.
The ng-app directive defines the root element of an AngularJS application. The ng-app directive will auto-bootstrap (automatically initialize) the application when a web page is loaded.
Angular2 desn' have ngCloak,
instead you can use ?.
operator (use it with object).
{{user?.name}}
AND/OR
you can use *ngIf (as of now)
<div *ngIf="name"> {{name}}</div>
There are two types of compilations in Angular2 ,Just-in-Time(JiT) and Ahead-of-Time(AoT). Just-in-Time is the default compilation.
JiT compilation incurs a runtime performance penalty.Views take longer to render because of the in-browser compilation step. The application is bigger because it includes the Angular compiler and a lot of library code that the application won't actually need. Bigger apps take longer to transmit and are slower to load.
With AoT, the browser downloads a pre-compiled version of the application. The browser loads executable code so it can render the application immediately, without waiting to compile the app first.
If we go with Ahead-of-Time compilation instead of Just-in-Time compilation, we can prevent such raw(uncompiled) form of display.
This link provides more information
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With