![]() ![]() Getting back to the main question to be answered, once Angular is triggered and root component of the app is selected and executed, the imports present in the `` tag is dynamically injected, it contains the contents of `main.ts`, present in `my-first-app/src/main.ts`. When `ng-serve` command is executed in CLI, the CLI bundles all the javascript and typescript files to dynamically injects the `` tag along with the right imports, inside the ‘index.html’ present in `my-first-app/src/`. It replaces with the template of the component named ‘app-root’, the template is the ‘’ file. It is called the Component Decorator, if you closely observe, the selector property in the Decorator is set to ‘app-root’, it is the same name tag given in ‘index.html’, this is the information Angular looks for when replacing the `` tag inside the ‘index.html’. selector: ‘app-root’, templateUrl: ‘./’, styleUrls: }) You can find the following contents present in the ‘.component.ts’ file. All the files with ‘.component’ in it’s file name are part of the root app component. This application will tie together the whole application. The `` is also known as the root component of the application. The index.html in my-first-app/src, is the only html file served by the server. ![]() How Angular apps get loaded and started ? Directives in Angular (Covers only the built-in directives in Angular 9).Īdvanced topics on Angular 9 will be covered in a successive article.How are Angular apps loaded and started?.Spend some time speculating about the files and folders created in the process before following this tutorial. ![]() This article is thoroughly focused on explaining the basic concepts in Angular 9.īefore you proceed further, I would highly recommend you to follow this link to learn how to install Angular, create a project in Angular and serve it to the localhost. This tutorial also assumes you have installed Angular 9 on your computer successfully. Familiarity with React or previous versions of Angular could also help. This tutorial is designed to address audience who have some basic knowledge about JavaScript. This is an elaborative tutorial on Angular 9 basics. Intended Audience and overview of the contents ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |