This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"builder": "@angular-devkit/build-angular:browser" | |
"builder": "@angular-devkit/build-angular:browser-esbuild" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loader = TestbedHarnessEnvironment | |
.loader(fixture); | |
const hasButton = await loader | |
.hasHarness(MatButtonHarness) | |
const buttonHarnessOrNull = await loader | |
.getHarnessOrNull(MatButtonHarness); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'my-component', | |
template: ` | |
<child [ngModel]="value"></child> | |
`, | |
changeDetection: ChangeDetectionStrategy.OnPush | |
}) | |
class MyComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viewContainer.createEmbeddedView(templateRef, context, { | |
injector: injector, | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'my-component', | |
template: '{{ message }}', // Now compiles! | |
}) | |
export class MyComponent { | |
protected message: string = 'Hello world'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({...}) | |
class MyComponent {} | |
@Directive({...}) | |
class MyDirective extends MyComponent {} // throws an error at runtime | |
// Before v14 the error is a string: | |
> Directives cannot inherit Components. Directive MyDirective is attempting to extend component MyComponent. | |
// Since v14 the error code makes this tree-shakeable: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"angularCompilerOptions": { | |
"extendedDiagnostics": { | |
// The categories to use for specific diagnostics. | |
"checks": { | |
// Maps check name to its category. | |
"invalidBananaInBox": "error" | |
"nullishCoalescingNotNullable": "warning" | |
}, | |
// The category to use for any diagnostics not listed in `checks` above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warning: src/app/app.component.ts:7:25 - warning NG8101: In the two-way binding syntax the parentheses should be inside the brackets, ex. '[(fruit)]="favoriteFruit"'. | |
Find more at https://angular.io/guide/two-way-binding | |
7 <app-favorite-fruit ([fruit])="favoriteFruit"></app-favorite-fruit> | |
~~~~~~~~~~~~~~~~~~~~~~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const routes: Routes = [{ | |
path: 'home', | |
component: HomeComponent | |
}, { | |
path: 'about', | |
component: AboutComponent, | |
title: 'About Me' // <-- Page title | |
}]; | |
@Injectable() |
NewerOlder