Understanding the Project
The why's and how's of omega template
The why's and how's of omega template
This section discusses the structure of the template and why certain things are at certain places. We will start by going through the root directory and understanding what each file represents.
This is where all the source code of your application stays. From components, to pages and any other code that is related to your app is stored here.
main.ts
Is the entry point of your application. This is where app is rendered to the browser and mounted on the DOM.
The app.ts
file contains the root component, that will hold all the other components, conditionals and even routers. This root component is mounted once, and it's DOM position is never altered by omega itself.
Contains all the files that is not source code, but media or assets that complements the source code to be able to link to those assets. All the sub-directories and media files inside of the public directory is directly accessible with their names on the server URL.
The index.html
file is the ultimate file that is sent to the browser along with the javascript bundle produced by OmegaJS. The index.html
file must contain a valid selector which is referenced by the omega web renderer.
Any CSS files, javascript files or any other files that can affect the page, will affect the page if loaded directly through <script> ... </script>
tags in the file.
To avoid unexpected side effects, it is better to refrain from using cdns that could influence how the applicaiton behaves. It is always better to install it as a package and use it from omega.