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.
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.
– 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.