docs: finalize adding code samples and embeds

This commit is contained in:
Corbin Crutchley
2023-12-29 00:51:23 -07:00
parent caede175fc
commit 2f8a596814
33 changed files with 52236 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title>Red Directive</title>
</head>
<body>
<app-root></app-root>
</body>
</html>

View File

@@ -0,0 +1,28 @@
import "zone.js";
import { bootstrapApplication } from "@angular/platform-browser";
import { Component, Directive, ElementRef, inject } from "@angular/core";
const injectAndMakeRed = () => {
const el = inject(ElementRef);
el.nativeElement.style.backgroundColor = "red";
el.nativeElement.style.color = "white";
};
@Directive({
selector: "[red]",
standalone: true,
})
class RedDirective {
_el = injectAndMakeRed();
}
@Component({
selector: "app-root",
standalone: true,
imports: [RedDirective],
template: ` <p red>This is red</p> `,
})
class AppComponent {}
bootstrapApplication(AppComponent);