This article mainly introduces AngularJS getting started tutorial (1): static templates. This is the second article in the series. This series will use a project to explain how to use AngularJS, for more information about how angularJS has enhanced the standard HTML, see create a static HTML page template and convert the static HTML page template to an AngularJS template that can be dynamically displayed.
In this step, we add the basic information of the two mobile phones to the HTML page and use the following command to reset the working directory to step 1.
The Code is as follows:
Git checkout-f step-1
Edit the app/index.html file, copy the following code to the index.html file, and run the application to view the effect.
App/index.html
The Code is as follows:
Exercise
Try to export multiple static html codes to index.html, for example:
The Code is as follows:
Total number of phones: 2
Summary
This step adds a static HTML mobile phone list to the application. Now let's go to step 2 to learn how to use AngularJS to dynamically generate the same list.