Basically, Templates is defined as the “view” and the “controller” is defined in the class. This is one of the properties of Component, which is a type of directive that has a controller and a view.

a

Let’s start with the basic of enhancing our Template. We will make a simple list of stocks and make it show on your browser.

b

– First we made a string type variable named ‘title’ and an array named ‘stocks’
– Next we injected the ‘title’ in the template and used an unordered list with the Directive *ngFor to display our array.
– Save your work and go to your browser and you’re done.

c

On the next article, we will be discussing “ngModule“.

JOIN THE ANGULAR ACADEMY!
$100,000 is the average annual salary of talented software developers and your chances of getting this salary get better by learning Angular 2 today!

Sign up now and make the first step towards upgrading your skill set.

PLUS: Get up to 75% OFF our Angular 2 course in Udemy!
We hate spam. Your email address will not be sold or shared with anyone else.