A component can be utilized with a component selector. This is not a requirement. For example, a component can be accessed via routing. In those cases, you can omit the selector. Otherwise, a selector is basically a “tag” that you can insert into your component template to display the content from your component logic/data. Here is an inline example…
@Component({
selector: 'app-selector',
template: `<div>
<h1>My Page Header</h1>
<app-selector></app-selector>
</div>`
})
For external, complex templates, it looks like this…
@Component({
selector: 'app-selector',
templateUrl: './app.component.html'
})
// <app-selector> would be used in the app.component.html file
By convention, the Angular style guide advises prefixing your selectors with ‘app-‘.
Happy Coding!
Clay Hess