-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Description
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
In angular v17, a new created project is standalone as default, what is great. Every new component created is automatically standalone. But, we still see 'standalone: true' flag in the @component metada, because its default value is false. So, what if the default value for this flag were TRUE and if the user wanted to create an ngModule component for some reason, he put 'standalone: false' in the metada?
Proposed solution
A standalone component should look like this:
@Component({
selector: 'app-root',
imports: [CommonModule, RouterOutlet],
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})An ngModule component should look like this:
@Component({
selector: 'app-root',
standalone: false,
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})Even though the standalone component boilerplate code is auto generated, is less code to see and it's easier to explain for new developers that is starting with Angular. And also, it makes more sense with the v17 purpose of creating standalone project as default with ng new.
Alternatives considered
...