- When a user access our web application the first file that is downloaded is index.html
- Index.html has the link and our script tag that our module loader hosts our application. This would be the entry point of our application
Index.html
System.js
- system.js is responsible for loading third party libraries or our own modules (Loads all our code files for us)
- This is the reason why we do not have to add script reference to our application
- The path for the default file load is defined in system.config.js . The file name for it is main.js. It is found under app folder
- The default extension is specified as ".js" this is the reason we do not have to specify the js extension
Hosting our angular 2 application
How does the module find the root of our application?
- system.import('app') in system.config.js is responsible for loading an es module from app folder
- system.config.js has the entry point defined as main.js . Main is the first es module loaded for our application
- Main.ts bootstraps our angular module providing us the starting point for us to kick off our application.
- We want the angular compiler to compile the application dynamically and then launch the application.It starts by importing platform-browser-dynamic
- Second import statement is to find our angular application module
- Finally we bootstrap our application
No comments:
Post a Comment