Skip to content

feat(platform-browser): add Link service for managing link tags#68650

Open
BHUVANSH855 wants to merge 1 commit into
angular:mainfrom
BHUVANSH855:feat-link-service
Open

feat(platform-browser): add Link service for managing link tags#68650
BHUVANSH855 wants to merge 1 commit into
angular:mainfrom
BHUVANSH855:feat-link-service

Conversation

@BHUVANSH855
Copy link
Copy Markdown
Contributor

@BHUVANSH855 BHUVANSH855 commented May 9, 2026

Adds a new Link service to @angular/platform-browser for managing HTML <link> tags.

The API is modeled after the existing Meta service and supports:

  • adding link tags
  • retrieving link tags
  • updating link tags
  • removing link tags
  • duplicate prevention
  • forced creation

Includes:

  • runtime tests
  • duplicate prevention logic
  • DI integration tests for BrowserModule support

Closes #68220

Related:

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Angular currently provides a Meta service for managing HTML <meta> tags, but there is no equivalent API for managing HTML <link> tags such as canonical links, preload hints, manifests, stylesheets, and related resources.

Issue Number: #68220

What is the new behavior?

This PR introduces a new Link service in @angular/platform-browser for managing HTML <link> tags.

The service supports:

  • adding single or multiple link tags
  • retrieving link tags by selector
  • updating existing link tags
  • removing link tags
  • duplicate prevention based on matching attributes
  • forced creation when duplicate checks should be bypassed

The implementation includes:

  • strict typing support
  • defensive selector handling
  • runtime test coverage
  • dependency injection integration with BrowserModule

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The API shape intentionally mirrors the existing Meta service to provide a familiar and consistent developer experience for managing document-level metadata elements.

@pullapprove pullapprove Bot requested a review from devversion May 9, 2026 18:55
@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: core Issues related to the framework runtime labels May 9, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 9, 2026
Adds a new Link service to @angular/platform-browser for managing
HTML link tags. The API is modeled after the existing Meta service
and supports adding, retrieving, updating, and removing link tags.

Includes runtime tests, duplicate prevention logic, and DI integration
tests for BrowserModule support.

Closes angular#68220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues related to the framework runtime detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(platform-browser): add Link service for managing <link> elements

1 participant