Skip to content

Commit

Permalink
fix[angular-gen2]: update selector to builder-content (#3576)
Browse files Browse the repository at this point in the history
## Description

"content" has been introduced as an HTMLElement in Angular v18. So we
are moving away from "content" as a selector to "builder-content"

Jira
https://builder-io.atlassian.net/browse/ENG-6887

_Screenshot_
If relevant, add a screenshot or two of the changes you made.
  • Loading branch information
sidmohanty11 committed Sep 25, 2024
1 parent 67acd97 commit 8bfd467
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-drinks-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@builder.io/sdk-angular": patch
---

Fix: update exported selector to `builder-content` to fix usage of Content component in Angular v18
4 changes: 2 additions & 2 deletions packages/sdks/e2e/angular-ssr/src/app/catch-all.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ interface BuilderProps {
selector: 'catch-all-route',
template: `
<ng-container *ngIf="content; else notFound">
<content
<builder-content
[model]="model"
[content]="content"
[apiKey]="apiKey"
[trustedHosts]="trustedHosts"
[canTrack]="canTrack"
[customComponents]="customComponents"
[data]="data"
></content>
></builder-content>
</ng-container>
<ng-template #notFound>
Expand Down
4 changes: 2 additions & 2 deletions packages/sdks/e2e/angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ interface BuilderProps {
selector: 'app-root',
template: `
<ng-container *ngIf="content; else notFound">
<content
<builder-content
[model]="model"
[content]="content"
[apiKey]="apiKey"
[trustedHosts]="trustedHosts"
[canTrack]="canTrack"
[customComponents]="customComponents"
[data]="data"
></content>
></builder-content>
</ng-container>
<ng-template #notFound>
Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/output/angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { fetchOneEntry, type BuilderContent } from '@builder.io/sdk-angular';
selector: 'app-catchall',
template: `
<ng-container *ngIf="content; else notFound">
<content [model]="model" [content]="content" [apiKey]="apiKey"></content>
<builder-content [model]="model" [content]="content" [apiKey]="apiKey"></builder-content>
</ng-container>
<ng-template #notFound>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import { type BuilderContent } from '@builder.io/sdk-angular';
selector: 'app-announcement-bar',
template: `
<ng-container *ngIf="content">
<content [model]="model" [content]="content" [apiKey]="apiKey"></content>
<builder-content
[model]="model"
[content]="content"
[apiKey]="apiKey"
></builder-content>
</ng-container>
<!-- Your content coming from your app (or also Builder) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { type BuilderContent } from '@builder.io/sdk-angular';
selector: 'app-catchall',
template: `
<ng-container *ngIf="content; else notFound">
<content [model]="model" [content]="content" [apiKey]="apiKey"></content>
<builder-content
[model]="model"
[content]="content"
[apiKey]="apiKey"
></builder-content>
</ng-container>
<ng-template #notFound>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { fetchOneEntry, type BuilderContent } from '@builder.io/sdk-angular';
selector: 'app-announcement-bar',
template: `
<ng-container *ngIf="content">
<content [model]="model" [content]="content" [apiKey]="apiKey"></content>
<builder-content
[model]="model"
[content]="content"
[apiKey]="apiKey"
></builder-content>
</ng-container>
<!-- Your content coming from your app (or also Builder) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import { fetchOneEntry, type BuilderContent } from '@builder.io/sdk-angular';
selector: 'app-catchall',
template: `
<ng-container *ngIf="content; else notFound">
<content [model]="model" [content]="content" [apiKey]="apiKey"></content>
<builder-content
[model]="model"
[content]="content"
[apiKey]="apiKey"
></builder-content>
</ng-container>
<ng-template #notFound>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ useMetadata({
setUseStoreFirst: true,
},
angular: {
selector: 'content, content-variants',
selector: 'builder-content, content-variants',
},
});

Expand Down

0 comments on commit 8bfd467

Please sign in to comment.