Sharing Top Content from the Angular-sphere.

Creating Your First Angular App: Implement Routing

  • The file is used to define a class with all the methods that we are going to use to access the information about different countries in one place.
  • The file contained the definition of the  class with different methods and properties to access and store information about all countries.
  • Just like the , the files contained the logic for our components, the files contained the template, and the files contained different rules that were applied to the elements in the template files.
  • After creating the template file, we will add the following CSS to to style the navigation links and the heading: – – Now we will be telling Angular which components need to be rendered for a particular route or path.
  • Create a file named inside the directory and put the following code in it: – – We begin by importing all the necessary dependencies, including the components that we want to render for different routes.

Before going ahead with this tutorial, it is a good idea to summarize everything we have done so far in order to avoid any confusion and errors. If you have missed any of the steps from the last…

Before going ahead with this tutorial, it is a good idea to summarize everything we have done so far in order to avoid any confusion and errors. If you have missed any of the steps from the last three tutorials, it is a good idea to go back and make the necessary changes.

In the second tutorial, we created three different files named , , and  . The  file is used to store the class definition so we can import it to different files. The file is used to store an array named .

This array stores all the country objects that we want to display inside our app. The file is used to define a class with all the methods that we are going to use to access the information about different countries in one place. The methods of the class are used to get the top countries based on criteria like population and area or find information about a country with given name.

In the third tutorial, we created the for our app. This was done with the help of three different files named , , and . The file contained the definition of the  class with different methods and properties to access and store information about all countries.

The methods inside the class relied on the methods defined in to get all the data. The file is used to…

Creating Your First Angular App: Implement Routing