_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
angular/adev/src/content/examples/accessibility/src/index.html_0_317 | <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Accessibility Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>
| {
"end_byte": 317,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/accessibility/src/index.html"
} |
angular/adev/src/content/examples/accessibility/src/main.ts_0_275 | import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser';
import {AppComponent} from './app/app.component';
bootstrapApplication(AppComponent, {
providers: [provideProtractorTestingSupport()],
}).catch((err) => console.error(err));
| {
"end_byte": 275,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/accessibility/src/main.ts"
} |
angular/adev/src/content/examples/accessibility/src/app/app.component.html_0_490 | <h1>Accessibility Example</h1>
<!-- #docregion template -->
<label for="progress-value">
Enter an example progress value
<input id="progress-value" type="number" min="0" max="100"
[value]="progress" (input)="setProgress($event)">
</label>
<!-- The user of the progressbar sets an aria-label to communicate wha... | {
"end_byte": 490,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/accessibility/src/app/app.component.html"
} |
angular/adev/src/content/examples/accessibility/src/app/app.component.ts_0_437 | import {Component} from '@angular/core';
import {ExampleProgressbarComponent} from './progress-bar.component';
@Component({
standalone: true,
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
imports: [ExampleProgressbarComponent],
})
export class AppComponent {
... | {
"end_byte": 437,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/accessibility/src/app/app.component.ts"
} |
angular/adev/src/content/examples/accessibility/src/app/progress-bar.component.css_4_208 | :host {
display: block;
width: 300px;
height: 25px;
border: 1px solid black;
margin-top: 16px;
}
.bar {
background: blue;
height: 100%;
} | {
"end_byte": 208,
"start_byte": 4,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/accessibility/src/app/progress-bar.component.css"
} |
angular/adev/src/content/examples/accessibility/src/app/progress-bar.component.ts_0_850 | /* eslint-disable @angular-eslint/no-host-metadata-property */
// #docregion progressbar-component
import {Component, Input} from '@angular/core';
/**
* Example progressbar component.
*/
@Component({
standalone: true,
selector: 'app-example-progressbar',
template: '<div class="bar" [style.width.%]="value"></di... | {
"end_byte": 850,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/accessibility/src/app/progress-bar.component.ts"
} |
angular/adev/src/content/examples/built-in-directives/BUILD.bazel_0_180 | package(default_visibility = ["//visibility:public"])
exports_files([
"src/app/app.component.html",
"src/app/app.component.ts",
"src/app/item-switch.component.ts",
])
| {
"end_byte": 180,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/BUILD.bazel"
} |
angular/adev/src/content/examples/built-in-directives/e2e/src/app.e2e-spec.ts_0_2688 | import {browser, element, by} from 'protractor';
describe('Built-in Directives', () => {
beforeAll(() => browser.get(''));
it('should have title Built-in Directives', async () => {
const title = element.all(by.css('h1')).get(0);
expect(await title.getText()).toEqual('Built-in Directives');
});
it('sh... | {
"end_byte": 2688,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/built-in-directives/src/index.html_0_303 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BuiltInDirectives</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
| {
"end_byte": 303,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/index.html"
} |
angular/adev/src/content/examples/built-in-directives/src/main.ts_0_275 | import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser';
import {AppComponent} from './app/app.component';
bootstrapApplication(AppComponent, {
providers: [provideProtractorTestingSupport()],
}).catch((err) => console.error(err));
| {
"end_byte": 275,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/main.ts"
} |
angular/adev/src/content/examples/built-in-directives/src/app/app.component.html_0_6612 | <h1>Built-in Directives</h1>
<h2>Built-in attribute directives</h2>
<h3 id="ngModel">NgModel (two-way) Binding</h3>
<fieldset><h4>NgModel examples</h4>
<p>Current item name: {{ currentItem.name }}</p>
<p>
<label for="without">without NgModel:</label>
<input [value]="currentItem.name" (input)="currentItem... | {
"end_byte": 6612,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/app/app.component.html"
} |
angular/adev/src/content/examples/built-in-directives/src/app/app.component.html_6612_8379 | <p>with trackBy and <em>semi-colon</em> separator</p>
<div class="box">
<!-- #docregion trackBy -->
<div *ngFor="let item of items; trackBy: trackByItems">
({{ item.id }}) {{ item.name }}
</div>
<!-- #enddocregion trackBy -->
</div>
<p>with trackBy and <em>comma</em> separator</p>
<div class="box">
<div ... | {
"end_byte": 8379,
"start_byte": 6612,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/app/app.component.html"
} |
angular/adev/src/content/examples/built-in-directives/src/app/item.ts_0_517 | export class Item {
static nextId = 0;
static items: Item[] = [
new Item(0, 'Teapot', 'stout'),
new Item(1, 'Lamp', 'bright'),
new Item(2, 'Phone', 'slim'),
new Item(3, 'Television', 'vintage'),
new Item(4, 'Fishbowl'),
];
constructor(
public id: number,
public name?: string,
p... | {
"end_byte": 517,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/app/item.ts"
} |
angular/adev/src/content/examples/built-in-directives/src/app/app.component.ts_0_5388 | import {Component, OnInit} from '@angular/core';
import {JsonPipe} from '@angular/common';
// #docregion import-ng-if
import {NgIf} from '@angular/common';
// #enddocregion import-ng-if
// #docregion import-ng-for
import {NgFor} from '@angular/common';
// #enddocregion import-ng-for
// #docregion import-ng-switch
impor... | {
"end_byte": 5388,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/app/app.component.ts"
} |
angular/adev/src/content/examples/built-in-directives/src/app/app.component.css_1_787 | button {
font-size: 100%;
margin: 0 2px;
}
div[ng-reflect-ng-switch], app-unknown-item {
margin: .5rem 0;
display: block;
}
#noTrackByCnt,
#withTrackByCnt {
color: darkred;
max-width: 450px;
margin: 4px;
}
img {
height: 100px;
}
.box {
border: 1px solid black;
padding: 6px;
max-width: 450px;
}
.child-... | {
"end_byte": 787,
"start_byte": 1,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/app/app.component.css"
} |
angular/adev/src/content/examples/built-in-directives/src/app/item-switch.component.ts_0_1319 | import {Component, Input} from '@angular/core';
import {Item} from './item';
@Component({
standalone: true,
selector: 'app-stout-item',
template: "I'm a little {{item.name}}, short and stout!",
})
// #docregion input
export class StoutItemComponent {
@Input() item!: Item;
}
// #enddocregion input
@Component(... | {
"end_byte": 1319,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/app/item-switch.component.ts"
} |
angular/adev/src/content/examples/built-in-directives/src/app/item-detail/item-detail.component.html_0_44 | <div>
<span>{{ item.name }}</span>
</div>
| {
"end_byte": 44,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/app/item-detail/item-detail.component.html"
} |
angular/adev/src/content/examples/built-in-directives/src/app/item-detail/item-detail.component.ts_0_301 | import {Component, Input} from '@angular/core';
import {Item} from '../item';
@Component({
standalone: true,
selector: 'app-item-detail',
templateUrl: './item-detail.component.html',
styleUrls: ['./item-detail.component.css'],
})
export class ItemDetailComponent {
@Input() item!: Item;
}
| {
"end_byte": 301,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/built-in-directives/src/app/item-detail/item-detail.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/BUILD.bazel_0_106 | package(default_visibility = ["//visibility:public"])
exports_files(["src/app/tree-shaking/service.ts"])
| {
"end_byte": 106,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/BUILD.bazel"
} |
angular/adev/src/content/examples/dependency-injection/e2e/src/app.e2e-spec.ts_0_7534 | import {browser, element, by, ElementFinder} from 'protractor';
describe('Dependency Injection Tests', () => {
let expectedMsg: string;
let expectedMsgRx: RegExp;
beforeAll(() => browser.get(''));
describe('Cars:', () => {
it('DI car displays as expected', async () => {
expectedMsg = 'DI car with 4... | {
"end_byte": 7534,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/index.html_0_287 | <!-- #docregion -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dependency Injection</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<app-root></app-root>
</body>
</html>
| {
"end_byte": 287,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/index.html"
} |
angular/adev/src/content/examples/dependency-injection/src/main.ts_0_204 | import {bootstrapApplication} from '@angular/platform-browser';
import {AppComponent} from './app/app.component';
import appConfig from './app/app.config';
bootstrapApplication(AppComponent, appConfig);
| {
"end_byte": 204,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/main.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/providers.module.ts_0_698 | import {NgModule} from '@angular/core';
import {
Provider1Component,
Provider3Component,
Provider4Component,
Provider5Component,
Provider6aComponent,
Provider6bComponent,
Provider7Component,
Provider8Component,
Provider9Component,
Provider10Component,
ProvidersComponent,
} from './providers.compo... | {
"end_byte": 698,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/providers.module.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/app.component.1.ts_0_429 | // #docregion
import {Component} from '@angular/core';
import {CarComponent} from './car/car.component';
import {HeroesComponent} from './heroes/heroes.component';
@Component({
standalone: true,
selector: 'app-root',
template: `
<h1>{{title}}</h1>
<app-car></app-car>
<app-heroes></app-heroes>
`,
... | {
"end_byte": 429,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/app.component.1.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/app-config.ts_0_275 | /*
Must put this interface in its own file instead of app.config.ts
or else TypeScript gives a (bogus) warning:
WARNING in ./src/app/... .ts
"export 'AppConfig' was not found in './app.config'
*/
export interface AppConfig {
apiEndpoint: string;
title: string;
}
| {
"end_byte": 275,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/app-config.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/test.component.ts_0_1487 | // Simulate a simple test
// Reader should look to the testing chapter for the real thing
import {Component} from '@angular/core';
import {Hero} from './heroes/hero';
import {HeroService} from './heroes/hero.service';
import {HeroListComponent} from './heroes/hero-list.component';
@Component({
standalone: true,
... | {
"end_byte": 1487,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/test.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/logger.service.ts_0_256 | // #docregion
import {Injectable} from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class Logger {
logs: string[] = []; // capture logs for testing
log(message: string) {
this.logs.push(message);
console.log(message);
}
}
| {
"end_byte": 256,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/logger.service.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/app.component.ts_0_1788 | import {Component, Inject} from '@angular/core';
import {APP_CONFIG, AppConfig} from './injection.config';
import {UserService} from './user.service';
import {HeroesComponent} from './heroes/heroes.component';
import {HeroesTspComponent} from './heroes/heroes-tsp.component';
import {ProvidersComponent} from './provide... | {
"end_byte": 1788,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/app.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/user.service.ts_0_476 | // #docregion
import {Injectable} from '@angular/core';
export class User {
constructor(
public name: string,
public isAuthorized = false,
) {}
}
// TODO: get the user; don't 'new' it.
const alice = new User('Alice', true);
const bob = new User('Bob', false);
@Injectable({
providedIn: 'root',
})
export... | {
"end_byte": 476,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/user.service.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/injection.config.ts_0_355 | import {AppConfig} from './app-config';
export {AppConfig} from './app-config';
// #docregion token
import {InjectionToken} from '@angular/core';
export const APP_CONFIG = new InjectionToken<AppConfig>('app.config');
// #enddocregion token
export const HERO_DI_CONFIG: AppConfig = {
apiEndpoint: 'api.heroes.com',
... | {
"end_byte": 355,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/injection.config.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/app.config.ts_0_483 | import {ApplicationConfig} from '@angular/core';
import {Logger} from './logger.service';
import {UserService} from './user.service';
import {APP_CONFIG, HERO_DI_CONFIG} from './injection.config';
import {provideProtractorTestingSupport} from '@angular/platform-browser';
const appConfig: ApplicationConfig = {
provid... | {
"end_byte": 483,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/app.config.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/app.component.2.ts_0_601 | import {Component, Inject} from '@angular/core';
import {APP_CONFIG, AppConfig} from './injection.config';
import {CarComponent} from './car/car.component';
import {HeroesComponent} from './heroes/heroes.component';
@Component({
standalone: true,
selector: 'app-root',
template: `
<h1>{{title}}</h1>
<app... | {
"end_byte": 601,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/app.component.2.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/injector.component.ts_0_1144 | // #docplaster
// #docregion
import {Component, Injector} from '@angular/core';
import {Car, Engine, Tires} from './car/car';
import {Hero} from './heroes/hero';
import {HeroService} from './heroes/hero.service';
import {heroServiceProvider} from './heroes/hero.service.provider';
import {Logger} from './logger.service... | {
"end_byte": 1144,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/injector.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/providers.component.ts_0_7319 | /*
* A collection of demo components showing different ways to provide services
* in @Component metadata
*/
import {Component, Inject, Injectable, OnInit} from '@angular/core';
import {APP_CONFIG, AppConfig, HERO_DI_CONFIG} from './injection.config';
import {HeroService} from './heroes/hero.service';
import {heroS... | {
"end_byte": 7319,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/providers.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/car/car.component.ts_0_980 | // #docregion
import {Component} from '@angular/core';
import {Car, Engine, Tires} from './car';
import {Car as CarNoDi} from './car-no-di';
import {CarFactory} from './car-factory';
import {testCar, simpleCar, superCar} from './car-creations';
import {useInjector} from './car-injector';
@Component({
standalone: ... | {
"end_byte": 980,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/car/car.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/car/car.ts_0_501 | import {Injectable} from '@angular/core';
export class Engine {
public cylinders = 4;
}
export class Tires {
public make = 'Flintstone';
public model = 'Square';
}
@Injectable()
export class Car {
public description = 'DI';
constructor(
public engine: Engine,
public tires: Tires,
) {}
// Meth... | {
"end_byte": 501,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/car/car.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/car/car-injector.ts_0_830 | import {Injector} from '@angular/core';
import {Car, Engine, Tires} from './car';
import {Logger} from '../logger.service';
export function useInjector() {
let injector: Injector;
/*
// Cannot instantiate an Injector like this!
let injector = new Injector([
{ provide: Car, deps: [Engine, Tires] },
{ p... | {
"end_byte": 830,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/car/car-injector.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/car/car-no-di.ts_0_431 | // Car without DI
import {Engine, Tires} from './car';
export class Car {
public engine: Engine;
public tires: Tires;
public description = 'No DI';
constructor() {
this.engine = new Engine();
this.tires = new Tires();
}
// Method using the engine and tires
drive() {
return (
`${this.d... | {
"end_byte": 431,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/car/car-no-di.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/car/car-creations.ts_0_968 | // Examples with car and engine variations
import {Car, Engine, Tires} from './car';
///////// example 1 ////////////
export function simpleCar() {
// Simple car with 4 cylinders and Flintstone tires.
const car = new Car(new Engine(), new Tires());
car.description = 'Simple';
return car;
}
///////// example ... | {
"end_byte": 968,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/car/car-creations.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/car/car-factory.ts_0_332 | // #docregion
import {Engine, Tires, Car} from './car';
// BAD pattern!
export class CarFactory {
createCar() {
const car = new Car(this.createEngine(), this.createTires());
car.description = 'Factory';
return car;
}
createEngine() {
return new Engine();
}
createTires() {
return new Tir... | {
"end_byte": 332,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/car/car-factory.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.2.ts_0_315 | import {Injectable} from '@angular/core';
import {HEROES} from './mock-heroes';
import {Logger} from '../logger.service';
@Injectable({
providedIn: 'root',
})
export class HeroService {
constructor(private logger: Logger) {}
getHeroes() {
this.logger.log('Getting heroes ...');
return HEROES;
}
}
| {
"end_byte": 315,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.2.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero.ts_0_91 | // #docregion
export interface Hero {
id: number;
name: string;
isSecret: boolean;
}
| {
"end_byte": 91,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.provider.ts_0_503 | // #docregion
import {HeroService} from './hero.service';
import {Logger} from '../logger.service';
import {UserService} from '../user.service';
// #docregion factory
const heroServiceFactory = (logger: Logger, userService: UserService) =>
new HeroService(logger, userService.user.isAuthorized);
// #enddocregion fact... | {
"end_byte": 503,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.provider.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.3.ts_0_291 | // #docregion
import {Injectable} from '@angular/core';
import {HEROES} from './mock-heroes';
@Injectable({
// declares that this service should be created
// by the root application injector.
providedIn: 'root',
})
export class HeroService {
getHeroes() {
return HEROES;
}
}
| {
"end_byte": 291,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.3.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero-list.component.2.ts_0_637 | // #docplaster
// #docregion
import {NgFor} from '@angular/common';
import {Component} from '@angular/core';
import {Hero} from './hero';
// #enddocregion
import {HeroService} from './hero.service.1';
/*
// #docregion
import { HeroService } from './hero.service';
// #enddocregion
*/
// #docregion
@Component({
standa... | {
"end_byte": 637,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero-list.component.2.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/mock-heroes.ts_0_492 | // #docregion
import {Hero} from './hero';
export const HEROES: Hero[] = [
{id: 12, isSecret: false, name: 'Dr. Nice'},
{id: 13, isSecret: false, name: 'Bombasto'},
{id: 14, isSecret: false, name: 'Celeritas'},
{id: 15, isSecret: false, name: 'Magneta'},
{id: 16, isSecret: false, name: 'RubberMan'},
{id: 1... | {
"end_byte": 492,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/mock-heroes.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/dummy.module.ts_0_786 | /// Dummy modules to satisfy Angular Language Service
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
////////
import {HeroListComponent as HeroListComponent1} from './hero-list.component.1';
@NgModule({
imports: [CommonModule],
declarations: [HeroListComponent1],
exports:... | {
"end_byte": 786,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/dummy.module.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/heroes.component.1.ts_0_373 | import {Component} from '@angular/core';
import {HeroService} from './hero.service';
import {HeroListComponent} from './hero-list.component';
@Component({
standalone: true,
selector: 'app-heroes',
providers: [HeroService],
template: `
<h2>Heroes</h2>
<app-hero-list></app-hero-list>
`,
imports: [He... | {
"end_byte": 373,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/heroes.component.1.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/heroes.component.ts_0_411 | // #docregion
import {Component} from '@angular/core';
import {heroServiceProvider} from './hero.service.provider';
import {HeroListComponent} from './hero-list.component';
@Component({
standalone: true,
selector: 'app-heroes',
providers: [heroServiceProvider],
template: `
<h2>Heroes</h2>
<app-hero-lis... | {
"end_byte": 411,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/heroes.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/heroes-tsp.component.ts_0_516 | import {Component} from '@angular/core';
import {HeroListComponent} from './hero-list.component';
/**
* A version of `HeroesComponent` that does not provide the `HeroService` (and thus relies on its
* `Injectable`-declared provider) in order to function.
*
* TSP stands for Tree-Shakeable Provider.
*/
@Component({... | {
"end_byte": 516,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/heroes-tsp.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.0.ts_0_110 | import {Injectable} from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class HeroService {}
| {
"end_byte": 110,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.0.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero-list.component.1.ts_0_368 | import {NgFor} from '@angular/common';
import {Component} from '@angular/core';
import {HEROES} from './mock-heroes';
@Component({
standalone: true,
selector: 'app-hero-list',
template: `
@for (hero of heroes; track hero) {
<div>{{hero.id}} - {{hero.name}}</div>
}
`,
imports: [NgFor],
})
export... | {
"end_byte": 368,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero-list.component.1.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.ts_0_760 | // #docregion
import {Injectable} from '@angular/core';
import {HEROES} from './mock-heroes';
import {Logger} from '../logger.service';
import {UserService} from '../user.service';
@Injectable({
providedIn: 'root',
useFactory: (logger: Logger, userService: UserService) =>
new HeroService(logger, userService.us... | {
"end_byte": 760,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.5.ts_0_525 | // #docregion
import {EnvironmentInjector, inject, Injectable, runInInjectionContext} from '@angular/core';
@Injectable({providedIn: 'root'})
export class SomeService {}
// #docregion run-in-context
@Injectable({
providedIn: 'root',
})
export class HeroService {
private environmentInjector = inject(EnvironmentInj... | {
"end_byte": 525,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.5.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero-list.component.ts_0_644 | // #docregion
import {Component} from '@angular/core';
import {Hero} from './hero';
import {HeroService} from './hero.service';
import {NgFor} from '@angular/common';
@Component({
standalone: true,
selector: 'app-hero-list',
template: `
@for (hero of heroes; track hero) {
<div>
{{hero.id}} - {{... | {
"end_byte": 644,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero-list.component.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.1.ts_0_202 | // #docregion
import {Injectable} from '@angular/core';
import {HEROES} from './mock-heroes';
@Injectable({
providedIn: 'root',
})
export class HeroService {
getHeroes() {
return HEROES;
}
}
| {
"end_byte": 202,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/heroes/hero.service.1.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/tree-shaking/app.module.ts_0_320 | import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {RouterModule} from '@angular/router';
import {ServiceModule} from './service-and-module';
// #docregion
@NgModule({
imports: [BrowserModule, RouterModule.forRoot([]), ServiceModule],
})
export class AppModule {}
| {
"end_byte": 320,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/tree-shaking/app.module.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/tree-shaking/service.0.ts_0_206 | import {Injectable} from '@angular/core';
// #docregion
@Injectable({
providedIn: 'root',
useFactory: () => new Service('dependency'),
})
export class Service {
constructor(private dep: string) {}
}
| {
"end_byte": 206,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/tree-shaking/service.0.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/tree-shaking/service.ts_0_120 | import {Injectable} from '@angular/core';
// #docregion
@Injectable({
providedIn: 'root',
})
export class Service {}
| {
"end_byte": 120,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/tree-shaking/service.ts"
} |
angular/adev/src/content/examples/dependency-injection/src/app/tree-shaking/service-and-module.ts_0_201 | // #docregion
import {Injectable, NgModule} from '@angular/core';
@Injectable()
export class Service {
doSomething(): void {}
}
@NgModule({
providers: [Service],
})
export class ServiceModule {}
| {
"end_byte": 201,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/dependency-injection/src/app/tree-shaking/service-and-module.ts"
} |
angular/adev/src/content/examples/animations/BUILD.bazel_0_1029 | package(default_visibility = ["//visibility:public"])
exports_files([
"src/app/animations.1.ts",
"src/app/animations.ts",
"src/app/app.component.html",
"src/app/app.component.ts",
"src/app/app.module.1.ts",
"src/app/app.routes.ts",
"src/app/hero-list-auto.component.ts",
"src/app/hero-li... | {
"end_byte": 1029,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/BUILD.bazel"
} |
angular/adev/src/content/examples/animations/e2e/src/enter-leave.po.ts_0_454 | import {by} from 'protractor';
import {locate} from './util';
export function getPage() {
return by.css('app-hero-list-enter-leave-page');
}
export function getComponent() {
return by.css('app-hero-list-enter-leave');
}
export function getComponentContainer() {
const findContainer = () => by.css('ul');
retur... | {
"end_byte": 454,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/enter-leave.po.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/app.e2e-spec.ts_0_8690 | import {browser} from 'protractor';
import {logging} from 'selenium-webdriver';
import * as openClose from './open-close.po';
import * as statusSlider from './status-slider.po';
import * as toggle from './toggle.po';
import * as enterLeave from './enter-leave.po';
import * as auto from './auto.po';
import * as filterSt... | {
"end_byte": 8690,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/app.e2e-spec.ts_8694_10148 | describe('Querying Component', () => {
const queryingAnimationDuration = 2500;
beforeAll(async () => {
await queryingHref.click();
await newPageSleepFor(queryingAnimationDuration);
});
it('should toggle the section', async () => {
const toggleButton = getToggleButton();
const s... | {
"end_byte": 10148,
"start_byte": 8694,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/filter-stagger.po.ts_0_463 | import {by} from 'protractor';
import {locate} from './util';
export function getPage() {
return by.css('app-hero-list-page');
}
export function getComponentContainer() {
const findContainer = () => by.css('ul');
return locate(getPage(), findContainer());
}
export function getHeroesList() {
return getCompone... | {
"end_byte": 463,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/filter-stagger.po.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/toggle.po.ts_0_712 | import {by} from 'protractor';
import {locate} from './util';
export function getPage() {
return by.css('app-toggle-animations-child-page');
}
export function getComponent() {
return by.css('app-open-close-toggle');
}
export function getToggleButton() {
const toggleButton = () => by.buttonText('Toggle Open/Clo... | {
"end_byte": 712,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/toggle.po.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/status-slider.po.ts_0_499 | import {by} from 'protractor';
import {locate} from './util';
export function getPage() {
return by.css('app-status-slider-page');
}
export function getComponent() {
return by.css('app-status-slider');
}
export function getToggleButton() {
const toggleButton = () => by.buttonText('Toggle Status');
return loc... | {
"end_byte": 499,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/status-slider.po.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/hero-groups.ts_0_444 | import {by} from 'protractor';
import {locate} from './util';
export function getPage() {
return by.css('app-hero-list-groups-page');
}
export function getComponent() {
return by.css('app-hero-list-groups');
}
export function getComponentContainer() {
const findContainer = () => by.css('ul');
return locate(g... | {
"end_byte": 444,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/hero-groups.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/querying.po.ts_0_410 | import {by} from 'protractor';
import {locate} from './util';
export function getComponent() {
return by.css('app-querying');
}
export function getToggleButton() {
const toggleButton = () => by.className('toggle');
return locate(getComponent(), toggleButton());
}
export function getComponentSection() {
const... | {
"end_byte": 410,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/querying.po.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/open-close.po.ts_0_662 | import {by} from 'protractor';
import {locate} from './util';
export function getPage() {
return by.css('app-open-close-page');
}
export function getComponent() {
return by.css('app-open-close');
}
export function getToggleButton() {
const toggleButton = () => by.buttonText('Toggle Open/Close');
return locat... | {
"end_byte": 662,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/open-close.po.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/util.ts_0_548 | import {Locator, ElementFinder, browser, by, element} from 'protractor';
/**
*
* locate(finder1, finder2) => element(finder1).element(finder2).element(finderN);
*/
export function locate(locator: Locator, ...locators: Locator[]) {
return locators.reduce(
(current: ElementFinder, next: Locator) => current.elem... | {
"end_byte": 548,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/util.ts"
} |
angular/adev/src/content/examples/animations/e2e/src/auto.po.ts_0_440 | import {by} from 'protractor';
import {locate} from './util';
export function getPage() {
return by.css('app-hero-list-auto-page');
}
export function getComponent() {
return by.css('app-hero-list-auto');
}
export function getComponentContainer() {
const findContainer = () => by.css('ul');
return locate(getCo... | {
"end_byte": 440,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/e2e/src/auto.po.ts"
} |
angular/adev/src/content/examples/animations/src/index.html_0_256 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Animations</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<app-root></app-root>
</body>
</html>
| {
"end_byte": 256,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/index.html"
} |
angular/adev/src/content/examples/animations/src/main.ts_0_206 | import {bootstrapApplication} from '@angular/platform-browser';
import {AppComponent} from './app/app.component';
import {appConfig} from './app/app.config';
bootstrapApplication(AppComponent, appConfig);
| {
"end_byte": 206,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/main.ts"
} |
angular/adev/src/content/examples/animations/src/app/app.component.html_0_1643 | <h1>Animations</h1>
<input type="checkbox"
id="animation-toggle"
[checked]="!animationsDisabled"
(click)="toggleAnimations()">
<label for="animation-toggle">Toggle All Animations</label>
<nav>
<a id="home" routerLink="/home" routerLinkActive="active" ariaCurrentWhenActive="page">Home</a>
<a i... | {
"end_byte": 1643,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/app.component.html"
} |
angular/adev/src/content/examples/animations/src/app/open-close.component.3.html_0_478 | <!-- #docplaster -->
<nav>
<button type="button" (click)="toggle()">Toggle Open/Close</button>
</nav>
<!-- #docregion callbacks -->
<div [@openClose]="isOpen ? 'open' : 'closed'"
(@openClose.start)="onAnimationEvent($event)"
(@openClose.done)="onAnimationEvent($event)"
class="open-close-container">
<!-... | {
"end_byte": 478,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.3.html"
} |
angular/adev/src/content/examples/animations/src/app/status-slider.component.ts_0_1711 | import {Component} from '@angular/core';
import {trigger, transition, state, animate, style, keyframes} from '@angular/animations';
@Component({
standalone: true,
selector: 'app-status-slider',
templateUrl: 'status-slider.component.html',
styleUrls: ['status-slider.component.css'],
animations: [
trigger(... | {
"end_byte": 1711,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/status-slider.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/hero-list-groups.component.ts_0_1941 | import {Component, Input, Output, EventEmitter} from '@angular/core';
import {trigger, state, style, animate, transition, group} from '@angular/animations';
import {Hero} from './hero';
import {NgFor} from '@angular/common';
@Component({
standalone: true,
selector: 'app-hero-list-groups',
template: `
<ul cl... | {
"end_byte": 1941,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-groups.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/hero.ts_0_56 | export interface Hero {
id: number;
name: string;
}
| {
"end_byte": 56,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero.ts"
} |
angular/adev/src/content/examples/animations/src/app/status-slider-page.component.ts_0_382 | import {Component} from '@angular/core';
import {StatusSliderComponent} from './status-slider.component';
@Component({
standalone: true,
selector: 'app-status-slider-page',
template: `
<section>
<h2>Status Slider</h2>
<app-status-slider></app-status-slider>
</section>
`,
imports: [StatusS... | {
"end_byte": 382,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/status-slider-page.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/about.component.html_0_127 | <p>
Angular's animations library makes it easy to define and apply animation effects such as page and list transitions.
</p>
| {
"end_byte": 127,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/about.component.html"
} |
angular/adev/src/content/examples/animations/src/app/hero-list-auto.component.ts_0_827 | 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-auto',
templateUrl: 'hero-list-auto.co... | {
"end_byte": 827,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-auto.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/open-close.component.css_0_212 | :host {
display: block;
margin-top: 1rem;
}
.open-close-container {
border: 1px solid #dddddd;
margin-top: 1em;
padding: 20px 20px 0px 20px;
color: #000000;
font-weight: bold;
font-size: 20px;
}
| {
"end_byte": 212,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.css"
} |
angular/adev/src/content/examples/animations/src/app/mock-heroes.ts_0_342 | // #docregion
import {Hero} from './hero';
export const HEROES: Hero[] = [
{id: 12, name: 'Dr. Nice'},
{id: 13, name: 'Bombasto'},
{id: 14, name: 'Celeritas'},
{id: 15, name: 'Magneta'},
{id: 16, name: 'RubberMan'},
{id: 17, name: 'Dynama'},
{id: 18, name: 'Dr. IQ'},
{id: 19, name: 'Magma'},
{id: 20,... | {
"end_byte": 342,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/mock-heroes.ts"
} |
angular/adev/src/content/examples/animations/src/app/home.component.ts_0_211 | import {Component} from '@angular/core';
@Component({
standalone: true,
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css'],
})
export class HomeComponent {}
| {
"end_byte": 211,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/home.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/open-close.component.2.html_0_395 | <!-- #docplaster -->
<nav>
<button type="button" (click)="toggle()">Toggle Boolean/Close</button>
</nav>
<!-- #docregion trigger-boolean -->
<div [@openClose]="isOpen ? true : false" class="open-close-container">
<!-- #enddocregion trigger-boolean -->
<p>The box is now {{ isOpen ? 'Open' : 'Closed' }}!</p>
<!-- #d... | {
"end_byte": 395,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.2.html"
} |
angular/adev/src/content/examples/animations/src/app/app.routes.ts_0_2155 | import {Routes} from '@angular/router';
import {OpenClosePageComponent} from './open-close-page.component';
import {StatusSliderPageComponent} from './status-slider-page.component';
import {ToggleAnimationsPageComponent} from './toggle-animations-page.component';
import {HeroListPageComponent} from './hero-list-page.co... | {
"end_byte": 2155,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/app.routes.ts"
} |
angular/adev/src/content/examples/animations/src/app/open-close.component.3.ts_0_944 | // #docplaster
// #docregion reusable
import {Component, Input} from '@angular/core';
import {transition, trigger, useAnimation, AnimationEvent} from '@angular/animations';
import {transitionAnimation} from './animations';
@Component({
standalone: true,
selector: 'app-open-close-reusable',
animations: [
trig... | {
"end_byte": 944,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.3.ts"
} |
angular/adev/src/content/examples/animations/src/app/hero-list-page.component.css_0_1204 | .heroes {
margin: 0 0 2em 0;
list-style-type: none;
padding: 0;
width: 15em;
}
.heroes li {
display: flex;
align-items: center;
width: 100%;
overflow: hidden;
}
.heroes .inner {
flex: 1;
background-color: #EEE;
margin: .5em;
padding: 0;
border-radius: 4px;
display: flex;
align-items: str... | {
"end_byte": 1204,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-page.component.css"
} |
angular/adev/src/content/examples/animations/src/app/hero-list-auto-page.component.ts_0_605 | import {Component} from '@angular/core';
import {HEROES} from './mock-heroes';
import {HeroListAutoComponent} from './hero-list-auto.component';
@Component({
standalone: true,
selector: 'app-hero-list-auto-page',
template: `
<section>
<h2>Automatic Calculation</h2>
<app-hero-list-auto [heroes]="... | {
"end_byte": 605,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-auto-page.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/hero-list.component.css_0_410 | ul {
list-style-type: none;
padding: 0;
}
li {
display: block;
width: 120px;
line-height: 50px;
padding: 0 10px;
box-sizing: border-box;
background-color: #eee;
border-radius: 4px;
margin: 10px;
cursor: pointer;
overflow: hidden;
white-space: nowrap;
}
.active {
background-color: #cfd8dc;
... | {
"end_byte": 410,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list.component.css"
} |
angular/adev/src/content/examples/animations/src/app/hero-list-page.component.html_0_566 | <!-- #docplaster -->
<h2>Filter/Stagger</h2>
<!-- #docregion filter-animations -->
<label for="search">Search heroes: </label>
<input type="text" id="search" #criteria
(input)="updateCriteria(criteria.value)"
placeholder="Search heroes">
<ul class="heroes" [@filterAnimation]="heroesTotal">
@for (hero ... | {
"end_byte": 566,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/hero-list-page.component.html"
} |
angular/adev/src/content/examples/animations/src/app/querying.component.ts_0_2721 | import {Component} from '@angular/core';
import {
trigger,
style,
animate,
transition,
group,
query,
animateChild,
keyframes,
} from '@angular/animations';
import {HEROES} from './mock-heroes';
import {NgIf} from '@angular/common';
@Component({
standalone: true,
selector: 'app-querying',
templat... | {
"end_byte": 2721,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/querying.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/status-slider.component.html_0_180 | <nav>
<button type="button" (click)="toggle()">Toggle Status</button>
</nav>
<div [@slideStatus]="status" class="box">
{{ status == 'active' ? 'Active' : 'Inactive' }}
</div>
| {
"end_byte": 180,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/status-slider.component.html"
} |
angular/adev/src/content/examples/animations/src/app/open-close.component.4.html_0_436 | <nav>
<button type="button" (click)="toggleAnimations()">Toggle Animations</button>
<button type="button" (click)="toggle()">Toggle Open/Closed</button>
</nav>
<!-- #docregion toggle-animation -->
<div [@.disabled]="isDisabled">
<div [@childAnimation]="isOpen ? 'open' : 'closed'"
class="open-close-container">... | {
"end_byte": 436,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.4.html"
} |
angular/adev/src/content/examples/animations/src/app/open-close.component.2.ts_0_658 | import {Component} from '@angular/core';
import {trigger, transition, state, animate, style} from '@angular/animations';
@Component({
standalone: true,
selector: 'app-open-close-boolean',
// #docregion trigger-boolean
animations: [
trigger('openClose', [
state('true', style({height: '*'})),
sta... | {
"end_byte": 658,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/open-close.component.2.ts"
} |
angular/adev/src/content/examples/animations/src/app/toggle-animations-page.component.ts_0_412 | import {Component} from '@angular/core';
import {OpenCloseChildComponent} from './open-close.component.4';
@Component({
standalone: true,
selector: 'app-toggle-animations-child-page',
template: `
<section>
<h2>Toggle Animations</h2>
<app-open-close-toggle></app-open-close-toggle>
</section>
... | {
"end_byte": 412,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/toggle-animations-page.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/app.component.ts_0_1410 | // #docplaster
// #docregion imports
import {Component, HostBinding} from '@angular/core';
import {
trigger,
state,
style,
animate,
transition,
// ...
} from '@angular/animations';
// #enddocregion imports
import {ChildrenOutletContexts, RouterLink, RouterOutlet} from '@angular/router';
import {slideInAnim... | {
"end_byte": 1410,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/app.component.ts"
} |
angular/adev/src/content/examples/animations/src/app/insert-remove.component.html_0_323 | <!-- #docplaster -->
<h2>Insert/Remove</h2>
<nav>
<button type="button" (click)="toggle()">Toggle Insert/Remove</button>
</nav>
<!-- #docregion insert-remove-->
@if (isShown) {
<div @myInsertRemoveTrigger class="insert-remove-container">
<p>The box is inserted</p>
</div>
}
<!-- #enddocregion insert-remove-... | {
"end_byte": 323,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/insert-remove.component.html"
} |
angular/adev/src/content/examples/animations/src/app/querying.component.css_0_449 | section {
border: 1px solid black;
overflow: hidden;
}
section > * {
margin: 1rem;
}
.hero {
display: flex;
align-items: center;
border-radius: 4px;
color: black;
background-color: #DDD;
}
.hero .badge {
display: inline-block;
font-size: small;
color: white;
padding: 0.5rem;
background-colo... | {
"end_byte": 449,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/animations/src/app/querying.component.css"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.