Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add support for "<%_", "_%>" and "-%>" delimiters in templating in @angular-devkit/core

Open
#23,169 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
28/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
tooling

Research direction

The issue identifies the @angular-devkit/core templating implementation but names no file or test. Start by locating that implementation and compare its delimiter handling with EJS; done means <%, _%> and -%> whitespace-slurping delimiters work for the shown schematic template.

Written by the indexing model from the issue text.

Description

area: @angular-devkit/core feature feature: in backlog

🚀 Feature request

Command (mark with an x)
  • generate
Description

The templating for the @angular/devkit library uses EJS, sort of but doesn't support whitespace slurping the way that the documentation of EJS has declared it. Having this would enable schematic templates to be much more flexible with their whitespace and therefor easier to read while still creating nicely formatted files.

Describe the solution you'd like

The three delimiters: "<%_", "_%>" and "-%>" should just be added and work the same way that they do in EJS.

I already have an idea of the code that I'd like to add, and a pull request almost ready. It's very simple and only affects one file.

Examples

Within @schematics/angular this would allow an example like the following

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
<%_ if (routing) { %>
import { AppRoutingModule } from './app-routing.module';
<%_ } -%>
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    <%_ if (routing) { -%>
    AppRoutingModule,
    <%_ } -%>
    BrowserModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Which would generate with the correct whitespace.

Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
16h 35m
Merged PRs (30d)
176

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from angular/angular-cli

All issues in angular/angular-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.