_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
angular/adev/src/content/examples/animations/src/app/about.component.ts_0_215
import {Component} from '@angular/core'; @Component({ standalone: true, selector: 'app-about', templateUrl: './about.component.html', styleUrls: ['./about.component.css'], }) export class AboutComponent {}
{ "end_byte": 215, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/about.component.ts" }
angular/adev/src/content/examples/animations/src/app/open-close.component.1.ts_0_1299
import {Component, Input} from '@angular/core'; import { trigger, transition, state, animate, style, keyframes, AnimationEvent, } from '@angular/animations'; @Component({ standalone: true, selector: 'app-open-close', animations: [ // #docregion trigger trigger('openClose', [ state( ...
{ "end_byte": 1299, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.1.ts" }
angular/adev/src/content/examples/animations/src/app/app.config.ts_0_480
import {ApplicationConfig} from '@angular/core'; import {routes} from './app.routes'; import {provideRouter} from '@angular/router'; import {provideProtractorTestingSupport} from '@angular/platform-browser'; import {provideAnimations} from '@angular/platform-browser/animations'; export const appConfig: ApplicationConf...
{ "end_byte": 480, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/app.config.ts" }
angular/adev/src/content/examples/animations/src/app/hero-list-enter-leave.component.ts_0_1251
import {Component, Input, Output, EventEmitter} from '@angular/core'; import {trigger, state, style, animate, transition} from '@angular/animations'; import {Hero} from './hero'; import {NgFor} from '@angular/common'; @Component({ standalone: true, selector: 'app-hero-list-enter-leave', template: ` <ul clas...
{ "end_byte": 1251, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-enter-leave.component.ts" }
angular/adev/src/content/examples/animations/src/app/home.component.html_0_45
<p> Welcome to Animations in Angular! </p>
{ "end_byte": 45, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/home.component.html" }
angular/adev/src/content/examples/animations/src/app/status-slider.component.css_0_178
:host { display: block; } .box { width: 300px; border: 5px solid black; display: block; line-height: 300px; text-align: center; font-size: 50px; color: white; }
{ "end_byte": 178, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/status-slider.component.css" }
angular/adev/src/content/examples/animations/src/app/open-close.component.ts_0_2986
// #docplaster import {Component, Input} from '@angular/core'; import {trigger, transition, state, animate, style, AnimationEvent} from '@angular/animations'; // #docregion component, events1 @Component({ standalone: true, selector: 'app-open-close', // #docregion trigger-wildcard1, trigger-transition animatio...
{ "end_byte": 2986, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.ts" }
angular/adev/src/content/examples/animations/src/app/open-close.component.html_0_308
<button type="button" (click)="toggle()">Toggle Open/Close</button> <div [@openClose]="isOpen ? 'open' : 'closed'" (@openClose.start)="onAnimationEvent($event)" (@openClose.done)="onAnimationEvent($event)" class="open-close-container"> <p>The box is now {{ isOpen ? 'Open' : 'Closed' }}!</p> </div>
{ "end_byte": 308, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.html" }
angular/adev/src/content/examples/animations/src/app/open-close.component.4.ts_0_1214
// #docplaster // #docregion import {Component} from '@angular/core'; import {trigger, transition, state, animate, style} from '@angular/animations'; // #docregion toggle-animation @Component({ // #enddocregion toggle-animation standalone: true, selector: 'app-open-close-toggle', templateUrl: 'open-close.compo...
{ "end_byte": 1214, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.4.ts" }
angular/adev/src/content/examples/animations/src/app/hero-list-enter-leave-page.component.ts_0_637
import {Component} from '@angular/core'; import {HEROES} from './mock-heroes'; import {HeroListEnterLeaveComponent} from './hero-list-enter-leave.component'; @Component({ standalone: true, selector: 'app-hero-list-enter-leave-page', template: ` <section> <h2>Enter/Leave</h2> <app-hero-list-enter...
{ "end_byte": 637, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-enter-leave-page.component.ts" }
angular/adev/src/content/examples/animations/src/app/insert-remove.component.ts_0_765
// #docplaster import {Component} from '@angular/core'; import {trigger, transition, animate, style} from '@angular/animations'; import {NgIf} from '@angular/common'; @Component({ standalone: true, selector: 'app-insert-remove', imports: [NgIf], animations: [ // #docregion enter-leave-trigger trigger('...
{ "end_byte": 765, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/insert-remove.component.ts" }
angular/adev/src/content/examples/animations/src/app/app.component.css_0_126
nav a { padding: .7rem; } h1 { margin-bottom: .3rem; } form { margin-bottom: 2rem; } nav { padding-bottom: 3rem; }
{ "end_byte": 126, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/app.component.css" }
angular/adev/src/content/examples/animations/src/app/hero-list-auto.component.html_0_301
<ul class="heroes"> @for (hero of heroes; track hero) { <li [@shrinkOut]="'in'"> <button class="inner" type="button" (click)="removeHero(hero.id)"> <span class="badge">{{ hero.id }}</span> <span class="name">{{ hero.name }}</span> </button> </li> } </ul>
{ "end_byte": 301, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-auto.component.html" }
angular/adev/src/content/examples/animations/src/app/app.module.1.ts_0_307
import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; @NgModule({ imports: [BrowserModule, BrowserAnimationsModule], declarations: [], bootstrap: [], }) export class AppModule {}
{ "end_byte": 307, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/app.module.1.ts" }
angular/adev/src/content/examples/animations/src/app/open-close.component.1.html_0_306
<!-- #docplaster --> <!-- #docregion trigger --> <nav> <button type="button" (click)="toggle()">Toggle Open/Close</button> </nav> <div [@openClose]="isOpen ? 'open' : 'closed'" class="open-close-container"> <p>The box is now {{ isOpen ? 'Open' : 'Closed' }}!</p> </div> <!-- #enddocregion trigger -->
{ "end_byte": 306, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.1.html" }
angular/adev/src/content/examples/animations/src/app/hero-list-group-page.component.ts_0_608
import {Component} from '@angular/core'; import {HEROES} from './mock-heroes'; import {HeroListGroupsComponent} from './hero-list-groups.component'; @Component({ standalone: true, selector: 'app-hero-list-groups-page', template: ` <section> <h2>Hero List Group</h2> <app-hero-list-groups [heroes]...
{ "end_byte": 608, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-group-page.component.ts" }
angular/adev/src/content/examples/animations/src/app/open-close-page.component.ts_0_632
import {Component} from '@angular/core'; import {OpenCloseComponent} from './open-close.component'; @Component({ standalone: true, selector: 'app-open-close-page', template: ` <section> <h2>Open Close Component</h2> <input type="checkbox" id="log-checkbox" [checked]="logging" (click)="toggleLoggi...
{ "end_byte": 632, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close-page.component.ts" }
angular/adev/src/content/examples/animations/src/app/insert-remove.component.css_0_195
:host { display: block; } .insert-remove-container { border: 1px solid #dddddd; margin-top: 1em; padding: 20px 20px 0px 20px; color: #000000; font-weight: bold; font-size: 20px; }
{ "end_byte": 195, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/insert-remove.component.css" }
angular/adev/src/content/examples/animations/src/app/animations.1.ts_0_741
// #docplaster // #docregion animation-const, trigger-const import {animation, style, animate, trigger, transition, useAnimation} from '@angular/animations'; // #enddocregion trigger-const export const transitionAnimation = animation([ style({ height: '{{ height }}', opacity: '{{ opacity }}', backgroundC...
{ "end_byte": 741, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/animations.1.ts" }
angular/adev/src/content/examples/animations/src/app/animations.ts_0_1914
import { animation, trigger, animateChild, group, transition, animate, style, query, } from '@angular/animations'; export const transitionAnimation = animation([ style({ height: '{{ height }}', opacity: '{{ opacity }}', backgroundColor: '{{ backgroundColor }}', }), animate('{{ time }}...
{ "end_byte": 1914, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/animations.ts" }
angular/adev/src/content/examples/animations/src/app/hero-list-page.component.ts_0_2368
// #docplaster // #docregion import {Component, HostBinding, OnInit} from '@angular/core'; import {trigger, transition, animate, style, query, stagger} from '@angular/animations'; import {HEROES} from './mock-heroes'; import {Hero} from './hero'; import {NgFor} from '@angular/common'; // #docregion filter-animations @...
{ "end_byte": 2368, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-page.component.ts" }
angular/adev/src/content/examples/reactive-forms/BUILD.bazel_0_545
package(default_visibility = ["//visibility:public"]) exports_files([ "src/app/app.component.1.html", "src/app/app.module.ts", "src/app/name-editor/name-editor.component.html", "src/app/name-editor/name-editor.component.ts", "src/app/profile-editor/profile-editor.component.1.html", "src/app/pro...
{ "end_byte": 545, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/BUILD.bazel" }
angular/adev/src/content/examples/reactive-forms/e2e/src/app.e2e-spec.ts_0_4802
import {browser, element, by} from 'protractor'; describe('Reactive forms', () => { const nameEditor = element(by.css('app-name-editor')); const profileEditor = element(by.css('app-profile-editor')); const nameEditorButton = element(by.cssContainingText('app-root > nav > button', 'Name Editor')); const profile...
{ "end_byte": 4802, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/e2e/src/app.e2e-spec.ts" }
angular/adev/src/content/examples/reactive-forms/src/index.html_0_269
<!DOCTYPE html> <!-- #docregion --> <html lang="en"> <head> <title>Angular Reactive Forms</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <app-root></app-root> </body> </html>
{ "end_byte": 269, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/index.html" }
angular/adev/src/content/examples/reactive-forms/src/main.ts_0_214
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {AppModule} from './app/app.module'; platformBrowserDynamic() .bootstrapModule(AppModule) .catch((err) => console.error(err));
{ "end_byte": 214, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/main.ts" }
angular/adev/src/content/examples/reactive-forms/src/app/app.component.html_0_325
<h1>Reactive Forms</h1> <nav> <button type="button" (click)="toggleEditor('name')">Name Editor</button> <button type="button" (click)="toggleEditor('profile')">Profile Editor</button> </nav> <app-name-editor *ngIf="showNameEditor"></app-name-editor> <app-profile-editor *ngIf="showProfileEditor"></app-profile-edi...
{ "end_byte": 325, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/app.component.html" }
angular/adev/src/content/examples/reactive-forms/src/app/app.module.ts_0_869
// #docplaster import {BrowserModule} from '@angular/platform-browser'; import {NgModule} from '@angular/core'; // #docregion imports import {ReactiveFormsModule} from '@angular/forms'; // #enddocregion imports import {AppComponent} from './app.component'; import {NameEditorComponent} from './name-editor/name-editor.c...
{ "end_byte": 869, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/app.module.ts" }
angular/adev/src/content/examples/reactive-forms/src/app/app.component.ts_0_487
import {Component} from '@angular/core'; export type EditorType = 'name' | 'profile'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], standalone: false, }) export class AppComponent { editor: EditorType = 'name'; get showNameEditor() { retur...
{ "end_byte": 487, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/app.component.ts" }
angular/adev/src/content/examples/reactive-forms/src/app/app.component.css_0_54
nav button { padding: 1rem; font-size: inherit; }
{ "end_byte": 54, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/app.component.css" }
angular/adev/src/content/examples/reactive-forms/src/app/app.component.1.html_0_278
<!-- #docplaster --> <h1>Reactive Forms</h1> <!-- #docregion app-name-editor--> <app-name-editor></app-name-editor> <!-- #enddocregion app-name-editor--> <!-- #docregion app-profile-editor --> <app-profile-editor></app-profile-editor> <!-- #enddocregion app-profile-editor -->
{ "end_byte": 278, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/app.component.1.html" }
angular/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.1.ts_0_1133
// #docplaster // #docregion formgroup, nested-formgroup import {Component} from '@angular/core'; // #docregion imports import {FormGroup, FormControl} from '@angular/forms'; // #enddocregion imports @Component({ selector: 'app-profile-editor', templateUrl: './profile-editor.component.html', styleUrls: ['./profi...
{ "end_byte": 1133, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.1.ts" }
angular/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.html_0_1725
<!-- #docplaster --> <!-- #docregion ng-submit --> <form [formGroup]="profileForm" (ngSubmit)="onSubmit()"> <!-- #enddocregion ng-submit --> <label for="first-name">First Name: </label> <input id="first-name" type="text" formControlName="firstName" required> <label for="last-name">Last Name: </label> <input id...
{ "end_byte": 1725, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.html" }
angular/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.1.html_0_1508
<!-- #docplaster --> <!-- #docregion formgroup --> <form [formGroup]="profileForm"> <label for="first-name">First Name: </label> <input id="first-name" type="text" formControlName="firstName"> <label for="last-name">Last Name: </label> <input id="last-name" type="text" formControlName="lastName"> <!-- #enddo...
{ "end_byte": 1508, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.1.html" }
angular/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.ts_0_1571
// #docplaster import {Component} from '@angular/core'; import {FormBuilder} from '@angular/forms'; // #docregion validator-imports import {Validators} from '@angular/forms'; // #enddocregion validator-imports import {FormArray} from '@angular/forms'; @Component({ selector: 'app-profile-editor', templateUrl: './pr...
{ "end_byte": 1571, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.ts" }
angular/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.2.ts_0_1565
// #docplaster // #docregion form-builder import {Component, inject} from '@angular/core'; // #docregion form-builder-imports import {FormBuilder} from '@angular/forms'; // #enddocregion form-builder-imports, form-builder // #docregion form-array-imports import {FormArray} from '@angular/forms'; // #docregion form-buil...
{ "end_byte": 1565, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.2.ts" }
angular/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.css_0_149
/* ProfileEditorComponent's private CSS styles */ form { padding-top: 1rem; } label { display: block; margin: .5em 0; font-weight: bold; }
{ "end_byte": 149, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/profile-editor/profile-editor.component.css" }
angular/adev/src/content/examples/reactive-forms/src/app/name-editor/name-editor.component.ts_0_571
// #docplaster // #docregion create-control import {Component} from '@angular/core'; import {FormControl} from '@angular/forms'; @Component({ selector: 'app-name-editor', templateUrl: './name-editor.component.html', styleUrls: ['./name-editor.component.css'], standalone: false, }) export class NameEditorCompon...
{ "end_byte": 571, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/name-editor/name-editor.component.ts" }
angular/adev/src/content/examples/reactive-forms/src/app/name-editor/name-editor.component.css_0_134
label { font-weight: bold; padding-bottom: .5rem; padding-top: 1rem; display: inline-block; } button { max-width: 300px; }
{ "end_byte": 134, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/name-editor/name-editor.component.css" }
angular/adev/src/content/examples/reactive-forms/src/app/name-editor/name-editor.component.html_0_398
<!-- #docregion control-binding --> <label for="name">Name: </label> <input id="name" type="text" [formControl]="name"> <!-- #enddocregion control-binding --> <!-- #docregion display-value --> <p>Value: {{ name.value }}</p> <!-- #enddocregion display-value --> <!-- #docregion update-value --> <button type="button" (c...
{ "end_byte": 398, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/reactive-forms/src/app/name-editor/name-editor.component.html" }
angular/adev/src/content/examples/dynamic-form/BUILD.bazel_0_473
package(default_visibility = ["//visibility:public"]) exports_files([ "src/app/app.component.ts", "src/app/dynamic-form.component.html", "src/app/dynamic-form.component.ts", "src/app/dynamic-form-question.component.html", "src/app/dynamic-form-question.component.ts", "src/app/question.service.t...
{ "end_byte": 473, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/BUILD.bazel" }
angular/adev/src/content/examples/dynamic-form/e2e/src/app.e2e-spec.ts_0_802
import {browser, element, by} from 'protractor'; describe('Dynamic Form', () => { beforeAll(() => browser.get('')); it('should submit form', async () => { const firstNameElement = element.all(by.css('input[id=firstName]')).get(0); expect(await firstNameElement.getAttribute('value')).toEqual('Bombasto'); ...
{ "end_byte": 802, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/e2e/src/app.e2e-spec.ts" }
angular/adev/src/content/examples/dynamic-form/src/index.html_0_311
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <base href="/"> <title>Dynamic Form</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="assets/sample.css"> </head> <body> <app-root></app-root> </body> </html>
{ "end_byte": 311, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/index.html" }
angular/adev/src/content/examples/dynamic-form/src/main.ts_0_254
// #docregion import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser'; import {AppComponent} from './app/app.component'; bootstrapApplication(AppComponent, { providers: [provideProtractorTestingSupport()], });
{ "end_byte": 254, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/main.ts" }
angular/adev/src/content/examples/dynamic-form/src/app/question-control.service.ts_0_551
// #docregion import {Injectable} from '@angular/core'; import {FormControl, FormGroup, Validators} from '@angular/forms'; import {QuestionBase} from './question-base'; @Injectable() export class QuestionControlService { toFormGroup(questions: QuestionBase<string>[]) { const group: any = {}; questions.forE...
{ "end_byte": 551, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/question-control.service.ts" }
angular/adev/src/content/examples/dynamic-form/src/app/question-textbox.ts_0_159
// #docregion import {QuestionBase} from './question-base'; export class TextboxQuestion extends QuestionBase<string> { override controlType = 'textbox'; }
{ "end_byte": 159, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/question-textbox.ts" }
angular/adev/src/content/examples/dynamic-form/src/app/question.service.ts_0_1088
// #docregion import {Injectable} from '@angular/core'; import {DropdownQuestion} from './question-dropdown'; import {QuestionBase} from './question-base'; import {TextboxQuestion} from './question-textbox'; import {of} from 'rxjs'; @Injectable() export class QuestionService { // TODO: get from a remote source of q...
{ "end_byte": 1088, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/question.service.ts" }
angular/adev/src/content/examples/dynamic-form/src/app/app.component.ts_0_762
// #docregion import {Component} from '@angular/core'; import {AsyncPipe} from '@angular/common'; import {DynamicFormComponent} from './dynamic-form.component'; import {QuestionService} from './question.service'; import {QuestionBase} from './question-base'; import {Observable} from 'rxjs'; @Component({ standalone...
{ "end_byte": 762, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/app.component.ts" }
angular/adev/src/content/examples/dynamic-form/src/app/dynamic-form-question.component.html_0_628
<!-- #docregion --> <div [formGroup]="form"> <label [attr.for]="question.key">{{ question.label }}</label> <div> @switch (question.controlType) { @case ('textbox') { <input [formControlName]="question.key" [id]="question.key" [type]="question.type"> } @case ('dropdown') { <select [i...
{ "end_byte": 628, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/dynamic-form-question.component.html" }
angular/adev/src/content/examples/dynamic-form/src/app/question-base.ts_0_818
// #docregion export class QuestionBase<T> { value: T | undefined; key: string; label: string; required: boolean; order: number; controlType: string; type: string; options: {key: string; value: string}[]; constructor( options: { value?: T; key?: string; label?: string; req...
{ "end_byte": 818, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/question-base.ts" }
angular/adev/src/content/examples/dynamic-form/src/app/dynamic-form-question.component.ts_0_585
// #docregion import {Component, Input} from '@angular/core'; import {FormGroup, ReactiveFormsModule} from '@angular/forms'; import {CommonModule} from '@angular/common'; import {QuestionBase} from './question-base'; @Component({ standalone: true, selector: 'app-question', templateUrl: './dynamic-form-question....
{ "end_byte": 585, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/dynamic-form-question.component.ts" }
angular/adev/src/content/examples/dynamic-form/src/app/dynamic-form.component.ts_0_993
// #docregion import {Component, Input, OnInit} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FormGroup, ReactiveFormsModule} from '@angular/forms'; import {DynamicFormQuestionComponent} from './dynamic-form-question.component'; import {QuestionBase} from './question-base'; import {Quest...
{ "end_byte": 993, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/dynamic-form.component.ts" }
angular/adev/src/content/examples/dynamic-form/src/app/dynamic-form.component.html_0_503
<!-- #docregion --> <div> <form (ngSubmit)="onSubmit()" [formGroup]="form"> @for (question of questions; track question) { <div class="form-row"> <app-question [question]="question" [form]="form"></app-question> </div> } <div class="form-row"> <button type="submit" [disabled]="...
{ "end_byte": 503, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/dynamic-form.component.html" }
angular/adev/src/content/examples/dynamic-form/src/app/question-dropdown.ts_0_161
// #docregion import {QuestionBase} from './question-base'; export class DropdownQuestion extends QuestionBase<string> { override controlType = 'dropdown'; }
{ "end_byte": 161, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/app/question-dropdown.ts" }
angular/adev/src/content/examples/dynamic-form/src/assets/sample.css_0_63
.errorMessage{ color:red; } .form-row{ margin-top: 10px; }
{ "end_byte": 63, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dynamic-form/src/assets/sample.css" }
angular/adev/src/content/examples/router/BUILD.bazel_0_132
package(default_visibility = ["//visibility:public"]) exports_files([ "src/app/app.component.1.html", "src/index.html", ])
{ "end_byte": 132, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/BUILD.bazel" }
angular/adev/src/content/examples/router/e2e/src/app.e2e-spec.ts_0_7042
import {browser, element, by, ExpectedConditions as EC} from 'protractor'; const numDashboardTabs = 5; const numCrises = 4; const numHeroes = 9; describe('Router', () => { beforeAll(() => browser.get('')); function getPageStruct() { const hrefEles = element.all(by.css('nav a')); const crisisDetail = elem...
{ "end_byte": 7042, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/e2e/src/app.e2e-spec.ts" }
angular/adev/src/content/examples/router/src/index.html_0_406
<!DOCTYPE html> <!-- #docregion --> <html lang="en"> <head> <!-- Set the base href --> <!-- #docregion base-href --> <base href="/"> <!-- #enddocregion base-href --> <title>Angular Router</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> ...
{ "end_byte": 406, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/index.html" }
angular/adev/src/content/examples/router/src/main.ts_0_228
// #docregion import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {AppModule} from './app/app.module'; platformBrowserDynamic() .bootstrapModule(AppModule) .catch((err) => console.error(err));
{ "end_byte": 228, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/main.ts" }
angular/adev/src/content/examples/router/src/app/app.component.html_0_713
<!-- #docregion --> <div class="wrapper"> <h1 class="title">Angular Router</h1> <nav> <a routerLink="/crisis-center" routerLinkActive="active" ariaCurrentWhenActive="page">Crisis Center</a> <a routerLink="/superheroes" routerLinkActive="active" ariaCurrentWhenActive="page">Heroes</a> <a routerLink="/adm...
{ "end_byte": 713, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.html" }
angular/adev/src/content/examples/router/src/app/message.service.ts_0_245
import {Injectable} from '@angular/core'; @Injectable({ providedIn: 'root', }) export class MessageService { messages: string[] = []; add(message: string) { this.messages.push(message); } clear() { this.messages = []; } }
{ "end_byte": 245, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/message.service.ts" }
angular/adev/src/content/examples/router/src/app/app-routing.module.ts_0_1293
// #docplaster // #docregion import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {ComposeMessageComponent} from './compose-message/compose-message.component'; import {PageNotFoundComponent} from './page-not-found/page-not-found.component'; import {authGuard} from './au...
{ "end_byte": 1293, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.ts" }
angular/adev/src/content/examples/router/src/app/app.component.4.ts_0_348
import {Component} from '@angular/core'; @Component({ selector: 'app-root', templateUrl: 'app.component.html', styleUrls: ['app.component.css'], standalone: false, }) export class AppComponent { // #docregion relative-to goToItems() { this.router.navigate(['items'], {relativeTo: this.route}); } // ...
{ "end_byte": 348, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.4.ts" }
angular/adev/src/content/examples/router/src/app/app.module.7.ts_0_1310
// #docregion import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {FormsModule} from '@angular/forms'; import {Router} from '@angular/router'; import {AppComponent} from './app.component'; import {PageNotFoundComponent} from './page-not-found/page-not-found.component...
{ "end_byte": 1310, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.7.ts" }
angular/adev/src/content/examples/router/src/app/app.component.2.html_0_340
<!-- #docregion --> <h1>Angular Router</h1> <nav> <a routerLink="/crisis-center" routerLinkActive="active" ariaCurrentWhenActive="page">Crisis Center</a> <a routerLink="/heroes" routerLinkActive="active" ariaCurrentWhenActive="page">Heroes</a> </nav> <div [@routeAnimation]="getAnimationData()"> <router-outlet></r...
{ "end_byte": 340, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.2.html" }
angular/adev/src/content/examples/router/src/app/app.module.3.ts_0_1164
// #docplaster // #docregion // #docregion remove-heroes import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {FormsModule} from '@angular/forms'; // #enddocregion remove-heroes import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; // #docregio...
{ "end_byte": 1164, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.3.ts" }
angular/adev/src/content/examples/router/src/app/app.component.1.ts_0_219
// #docregion import {Component} from '@angular/core'; @Component({ selector: 'app-root', templateUrl: 'app.component.html', styleUrls: ['app.component.css'], standalone: false, }) export class AppComponent {}
{ "end_byte": 219, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.1.ts" }
angular/adev/src/content/examples/router/src/app/app.module.2.ts_0_690
import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {FormsModule} from '@angular/forms'; import {AppComponent} from './app.component'; import {AppRoutingModule} from './app-routing.module'; import {CrisisListComponent} from './crisis-list/crisis-list.component'; imp...
{ "end_byte": 690, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.2.ts" }
angular/adev/src/content/examples/router/src/app/selective-preloading-strategy.service.ts_0_734
// #docregion import {Injectable} from '@angular/core'; import {PreloadingStrategy, Route} from '@angular/router'; import {Observable, of} from 'rxjs'; @Injectable({ providedIn: 'root', }) export class SelectivePreloadingStrategyService implements PreloadingStrategy { preloadedModules: string[] = []; preload(ro...
{ "end_byte": 734, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/selective-preloading-strategy.service.ts" }
angular/adev/src/content/examples/router/src/app/app.module.6.ts_0_637
// #docregion import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {FormsModule} from '@angular/forms'; import {Routes, RouterModule} from '@angular/router'; import {AppComponent} from './app.component'; import {PageNotFoundComponent} from './page-not-found/page-not-f...
{ "end_byte": 637, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.6.ts" }
angular/adev/src/content/examples/router/src/app/app.component.4.html_0_587
<!-- #docregion --> <h1>Angular Router</h1> <nav> <a routerLink="/crisis-center" routerLinkActive="active" ariaCurrentWhenActive="page">Crisis Center</a> <a routerLink="/heroes" routerLinkActive="active" ariaCurrentWhenActive="page">Heroes</a> <!-- #docregion contact-link --> <a [routerLink]="[{ outlets: { popu...
{ "end_byte": 587, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.4.html" }
angular/adev/src/content/examples/router/src/app/app-routing.module.10.ts_0_1568
// #docplaster import {Injectable, NgModule} from '@angular/core'; import {Title} from '@angular/platform-browser'; import {ResolveFn, RouterModule, RouterStateSnapshot, Routes, TitleStrategy} from '@angular/router'; // CLI imports router // #docregion page-title const routes: Routes = [ { path: 'first-component...
{ "end_byte": 1568, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.10.ts" }
angular/adev/src/content/examples/router/src/app/dialog.service.ts_0_653
// #docregion import {Injectable} from '@angular/core'; import {Observable, of} from 'rxjs'; /** * Async modal dialog service * DialogService makes this app easier to test by faking this service. * TODO: better modal implementation that doesn't use window.confirm */ @Injectable({ providedIn: 'root', }) export cl...
{ "end_byte": 653, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/dialog.service.ts" }
angular/adev/src/content/examples/router/src/app/app.component.8.html_0_501
<!-- #docregion child-routes--> <h2>First Component</h2> <nav> <ul> <li><a routerLink="child-a">Child A</a></li> <li><a routerLink="child-b">Child B</a></li> </ul> </nav> <router-outlet></router-outlet> <!-- #enddocregion child-routes--> <!-- #docregion relative-route--> <h2>First Component</h2> <nav>...
{ "end_byte": 501, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.8.html" }
angular/adev/src/content/examples/router/src/app/app-routing.module.4.ts_0_767
// #docregion import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {ComposeMessageComponent} from './compose-message/compose-message.component'; import {CanDeactivateGuard} from './can-deactivate.guard'; import {PageNotFoundComponent} from './page-not-found/page-not-foun...
{ "end_byte": 767, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.4.ts" }
angular/adev/src/content/examples/router/src/app/can-deactivate.guard.ts_0_397
// #docregion import {CanDeactivateFn} from '@angular/router'; import {Observable} from 'rxjs'; export interface CanComponentDeactivate { canDeactivate?: () => Observable<boolean> | Promise<boolean> | boolean; } export const canDeactivateGuard: CanDeactivateFn<CanComponentDeactivate> = ( component: CanComponentDe...
{ "end_byte": 397, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/can-deactivate.guard.ts" }
angular/adev/src/content/examples/router/src/app/app-routing.module.5.ts_0_1027
// #docplaster // #docregion import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {ComposeMessageComponent} from './compose-message/compose-message.component'; import {PageNotFoundComponent} from './page-not-found/page-not-found.component'; import {authGuard} from './au...
{ "end_byte": 1027, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.5.ts" }
angular/adev/src/content/examples/router/src/app/app.module.8.ts_0_471
import {BrowserModule} from '@angular/platform-browser'; import {NgModule} from '@angular/core'; import {AppRoutingModule} from './app-routing.module'; // CLI imports AppRoutingModule import {AppComponent} from './app.component'; @NgModule({ declarations: [AppComponent], imports: [ BrowserModule, AppRoutin...
{ "end_byte": 471, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.8.ts" }
angular/adev/src/content/examples/router/src/app/app-routing.module.11.ts_0_1070
import {NgModule} from '@angular/core'; import {provideRouter, Routes, withComponentInputBinding} from '@angular/router'; import {authGuard} from './auth/auth.guard'; import {ComposeMessageComponent} from './compose-message/compose-message.component'; import {PageNotFoundComponent} from './page-not-found/page-not-foun...
{ "end_byte": 1070, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.11.ts" }
angular/adev/src/content/examples/router/src/app/app.module.ts_0_1768
// #docplaster // #docregion auth, preload import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {FormsModule} from '@angular/forms'; // #docregion animations-module import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; // #enddocregion auth, an...
{ "end_byte": 1768, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.ts" }
angular/adev/src/content/examples/router/src/app/app.component.5.html_0_559
<!-- #docregion --> <h1 class="title">Angular Router</h1> <nav> <a routerLink="/crisis-center" routerLinkActive="active" ariaCurrentWhenActive="page">Crisis Center</a> <a routerLink="/heroes" routerLinkActive="active" ariaCurrentWhenActive="page">Heroes</a> <a routerLink="/admin" routerLinkActive="active" ariaCur...
{ "end_byte": 559, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.5.html" }
angular/adev/src/content/examples/router/src/app/app-routing.module.1.ts_0_832
// #docregion import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {CrisisListComponent} from './crisis-list/crisis-list.component'; import {HeroListComponent} from './hero-list/hero-list.component'; import {PageNotFoundComponent} from './page-not-found/page-not-found.co...
{ "end_byte": 832, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.1.ts" }
angular/adev/src/content/examples/router/src/app/app.component.ts_0_550
// #docplaster // #docregion import {Component} from '@angular/core'; import {ChildrenOutletContexts} from '@angular/router'; import {slideInAnimation} from './animations'; @Component({ selector: 'app-root', templateUrl: 'app.component.html', styleUrls: ['app.component.css'], animations: [slideInAnimation], ...
{ "end_byte": 550, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.ts" }
angular/adev/src/content/examples/router/src/app/app.component.6.html_0_649
<!-- #docregion --> <h1 class="title">Angular Router</h1> <nav> <a routerLink="/crisis-center" routerLinkActive="active" ariaCurrentWhenActive="page">Crisis Center</a> <a routerLink="/heroes" routerLinkActive="active" ariaCurrentWhenActive="page">Heroes</a> <a routerLink="/admin" routerLinkActive="active" ariaCur...
{ "end_byte": 649, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.6.html" }
angular/adev/src/content/examples/router/src/app/app-routing.module.6.ts_0_1336
// #docplaster // #docregion, preload-v1 import {NgModule} from '@angular/core'; import { RouterModule, Routes, // #enddocregion preload-v1 PreloadAllModules, // #docregion preload-v1 } from '@angular/router'; import {ComposeMessageComponent} from './compose-message/compose-message.component'; import {PageNo...
{ "end_byte": 1336, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.6.ts" }
angular/adev/src/content/examples/router/src/app/app-routing.module.2.ts_0_1007
// #docregion // #docregion milestone3 import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {CrisisListComponent} from './crisis-list/crisis-list.component'; // #enddocregion milestone3 // import { HeroListComponent } from './hero-list/hero-list.component'; // <-- delet...
{ "end_byte": 1007, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.2.ts" }
angular/adev/src/content/examples/router/src/app/app-routing.module.3.ts_0_857
// #docplaster // #docregion , v3 import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; // #enddocregion v3 import {ComposeMessageComponent} from './compose-message/compose-message.component'; // #docregion v3 import {PageNotFoundComponent} from './page-not-found/page-not-found....
{ "end_byte": 857, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.3.ts" }
angular/adev/src/content/examples/router/src/app/app.component.7.html_0_527
<h1>Angular Router App</h1> <!-- This nav gives you links to click, which tells the router which route to use (defined in the routes constant in AppRoutingModule) --> <nav> <ul> <li><a routerLink="/first-component" routerLinkActive="active" ariaCurrentWhenActive="page">First Component</a></li> <li><a routerL...
{ "end_byte": 527, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.7.html" }
angular/adev/src/content/examples/router/src/app/app-routing.module.7.ts_0_362
import {NgModule} from '@angular/core'; import {Routes, RouterModule} from '@angular/router'; // CLI imports router const routes: Routes = []; // sets up routes constant where you define your routes // configures NgModule imports and exports @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterMod...
{ "end_byte": 362, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.7.ts" }
angular/adev/src/content/examples/router/src/app/app.component.css_0_27
nav a { padding: 1rem; }
{ "end_byte": 27, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.css" }
angular/adev/src/content/examples/router/src/app/app.component.2.ts_0_690
/* Second Heroes version */ // #docregion import {Component} from '@angular/core'; // #docregion animation-imports import {ChildrenOutletContexts} from '@angular/router'; import {slideInAnimation} from './animations'; @Component({ selector: 'app-root', templateUrl: 'app.component.html', styleUrls: ['app.componen...
{ "end_byte": 690, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.2.ts" }
angular/adev/src/content/examples/router/src/app/app.module.1.ts_0_1370
// #docplaster // #docregion // #docregion first-config import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {BrowserModule} from '@angular/platform-browser'; import {RouterModule, Routes} from '@angular/router'; import {AppComponent} from './app.component'; import {CrisisListComp...
{ "end_byte": 1370, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.1.ts" }
angular/adev/src/content/examples/router/src/app/app-routing.module.8.ts_0_791
// #docplaster import {NgModule} from '@angular/core'; import {Routes, RouterModule} from '@angular/router'; // CLI imports router // #docregion routes, routes-with-wildcard, redirect const routes: Routes = [ {path: 'first-component', component: FirstComponent}, {path: 'second-component', component: SecondComponen...
{ "end_byte": 791, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.8.ts" }
angular/adev/src/content/examples/router/src/app/can-deactivate.guard.1.ts_0_954
// #docregion import {Observable} from 'rxjs'; import {CanDeactivateFn, ActivatedRouteSnapshot, RouterStateSnapshot} from '@angular/router'; import {CrisisDetailComponent} from './crisis-center/crisis-detail/crisis-detail.component'; export const canDeactivateGuard: CanDeactivateFn<CrisisDetailComponent> = ( compon...
{ "end_byte": 954, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/can-deactivate.guard.1.ts" }
angular/adev/src/content/examples/router/src/app/app.module.5.ts_0_891
// #docplaster // #docregion import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FormsModule} from '@angular/forms'; import {AppComponent} from './app.component'; import {AppRoutingModule} from './app-routing.module'; import {HeroesModule} from './heroes/heroes.module'; impor...
{ "end_byte": 891, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.5.ts" }
angular/adev/src/content/examples/router/src/app/app.component.1.html_0_287
<!-- #docregion --> <h1>Angular Router</h1> <nav> <a routerLink="/crisis-center" routerLinkActive="active" ariaCurrentWhenActive="page">Crisis Center</a> <a routerLink="/heroes" routerLinkActive="active" ariaCurrentWhenActive="page">Heroes</a> </nav> <router-outlet></router-outlet>
{ "end_byte": 287, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.1.html" }
angular/adev/src/content/examples/router/src/app/app-routing.module.9.ts_0_776
// #docplaster import {NgModule} from '@angular/core'; import {Routes, RouterModule} from '@angular/router'; // CLI imports router // #docregion child-routes const routes: Routes = [ { path: 'first-component', component: FirstComponent, // this is the component with the <router-outlet> in the template ch...
{ "end_byte": 776, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app-routing.module.9.ts" }
angular/adev/src/content/examples/router/src/app/app.module.4.ts_0_1208
// #docplaster // #docregion // #docregion crisis-center-module, admin-module import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FormsModule} from '@angular/forms'; import {AppComponent} from './app.component'; import {PageNotFoundComponent} from './page-not-found/page-not-fo...
{ "end_byte": 1208, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.4.ts" }
angular/adev/src/content/examples/router/src/app/animations.ts_0_715
// #docregion import {trigger, animateChild, group, transition, animate, style, query} from '@angular/animations'; // Routable animations export const slideInAnimation = trigger('routeAnimation', [ transition('heroes <=> hero', [ style({position: 'relative'}), query(':enter, :leave', [ style({ ...
{ "end_byte": 715, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/animations.ts" }
angular/adev/src/content/examples/router/src/app/app.component.3.ts_0_1408
// #docplaster import {Component} from '@angular/core'; import {Router} from '@angular/router'; @Component({ selector: 'app-root', /* Typical link // #docregion h-anchor <a [routerLink]="['/heroes']">Heroes</a> // #enddocregion h-anchor */ /* Incomplete Crisis Center link when CC lacks a default ...
{ "end_byte": 1408, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.component.3.ts" }
angular/adev/src/content/examples/router/src/app/app.module.0.ts_0_1140
// NEVER USED. For docs only. Should compile though // #docplaster import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {HeroListComponent} from './hero-list/hero-list.component'; import {CrisisListComponent} from './crisis-list/crisis-list.component'; import {PageNotFou...
{ "end_byte": 1140, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/router/src/app/app.module.0.ts" }