ng generate component my-component
// my-component.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-my-component',
template: '<p>This is my component!</p>',
styleUrls: ['./my-component.component.css']
})
export class MyComponent { }
@Component({
selector: 'app-my-component',
// ...
})
@Component({
// ...
template: '<p>{{ greeting }}</p>'
})
@Component({
// ...
styleUrls: ['./my-component.component.css']
})