Skip to content

Inconsistent default templates in App component for inline template vs external template file #32176

@mikem-of

Description

@mikem-of

Command

new

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When generating a new project, an App component is created with inconsistent templates, depending on whether you use internal or external templates.

When you use ng new -t (inline template), the default h1 contains Welcome to {{ title() }}!:

When you use ng new (external template file), the default h1 contains Hello, {{ title() }}:

When I add Cypress using ng e2e, it will create this default assertion: cy.contains('app is running') . This assertion fails when you use inline templates.

The inline and external default templates should be consistent in my opinion, so external tooling can assert on it.

Minimal Reproduction

When you use ng new -t (inline template), the default h1 contains Welcome to {{ title() }}!:

When you use ng new (external template file), the default h1 contains Hello, {{ title() }}:

Exception or Error


Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI       : 21.0.4
Node.js           : 22.21.1
Package Manager   : npm 10.9.4
Operating System  : win32 x64

Anything else relevant?

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions