Sharing Top Content from the Angular-sphere.

Creating Your First Simple Angular Application

  • In Angular applications we rarely talk about the index.html file.
  • Our Angular CLI has set up everything for us so that after building the application, Webpack automatically includes everything for us inside the index.html file.
  • We will also use component specific CSS files in our applications.
  • This tag is specified at some place in our Angular application that we will have a look in another section of this article.
  • For now, keep in mind that this is the entry point of showing our application views in the index.html file.

Creating Your First Simple Angular Application – DiscoverSDK Blog

In the previous article I covered how to create a new project with Angular CLI and start a very simple Angular web application. We did not write a single line of code and did not modify anything. In this article we will start modifying our very minimal Angular application and make an application of our own.

In Angular applications we rarely talk about the index.html file. We create it and we forget about it. Let’s see what content we have in our existing index.html file.

There is no link to JavaScript or CSS files present in the file. Even, no link to any Angular JavaScript/Typescript files exists. We do not need to include them. Our Angular CLI has set up everything for us so that after building the application, Webpack automatically includes everything for us inside the index.html file. As a result at this beginning stage you do not need to worry about how that is being done. We will explore internals in some future articles when you have moved to a more advanced stage in learning Angular.

There is also a style.css in the root src directory of your Angular project. This is the root stylesheet for your angular application. We will also use component specific CSS files in our applications.

The most important part of index.html is inside body. app-root is the placeholder for our application. This…

Creating Your First Simple Angular Application

Comments are closed, but trackbacks and pingbacks are open.