The reason Angular 4 changed
to is because there is a name conflict between the tag and the html standard tag. }"> The template element is the element the directive is attached to. We tell Angular that this part should be assigned to a FormGroup named “serviceInfo”. Supercharge your JavaScript with static types, Master Observables and Reactive Programming, Build superfast component-based applications, Everything you need to become an Angular expert. With the statement "let element of array" we are defining a variable "element", that holds a reference to the current array element. In this tutorial I explain how to display content in you HTML template. So what do these do? If your API returns unique data, then using that would be a preferable solution over index - as the index may be subject to change if you reorder your collection. Let’s check some of the source code: Here, Angular is using attribute selectors as the value of selector to tell the @Directive decorator what attributes to look for.