_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
angular/adev/src/content/examples/testing/src/app/shared/highlight.directive.spec.ts_0_3657 | import {Component, DebugElement} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {HighlightDirective} from './highlight.directive';
// #docregion test-component
@Component({
standalone: true,
template: ` <h2 highlight="yel... | {
"end_byte": 3657,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/shared/highlight.directive.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/shared/shared.ts_0_290 | import {FormsModule} from '@angular/forms';
import {HighlightDirective} from './highlight.directive';
import {TitleCasePipe} from './title-case.pipe';
import {NgFor, NgIf} from '@angular/common';
export const sharedImports = [FormsModule, HighlightDirective, TitleCasePipe, NgIf, NgFor];
| {
"end_byte": 290,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/shared/shared.ts"
} |
angular/adev/src/content/examples/testing/src/app/shared/title-case.pipe.ts_0_439 | // #docregion
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({name: 'titlecase', standalone: true, pure: true})
/** Transform to Title Case: uppercase the first letter of the words in a string. */
export class TitleCasePipe implements PipeTransform {
transform(input: string): string {
return input.leng... | {
"end_byte": 439,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/shared/title-case.pipe.ts"
} |
angular/adev/src/content/examples/testing/src/app/shared/canvas.component.ts_0_1121 | // #docplaster
// #docregion import-canvas-patch
// Import patch to make async `HTMLCanvasElement` methods (such as `.toBlob()`) Zone.js-aware.
// Either import in `polyfills.ts` (if used in more than one places in the app) or in the component
// file using `HTMLCanvasElement` (if it is only used in a single file).
imp... | {
"end_byte": 1121,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/shared/canvas.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/about/about.component.spec.ts_0_979 | import {provideHttpClient} from '@angular/common/http';
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {UserService} from '../model';
import {TwainService} from '../twain/twain.service';
import {AboutComponent} from './about.component';
l... | {
"end_byte": 979,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/about/about.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/about/about.component.ts_0_417 | // #docregion
import {Component} from '@angular/core';
import {HighlightDirective} from '../shared/highlight.directive';
import {TwainComponent} from '../twain/twain.component';
@Component({
standalone: true,
template: `
<h2 highlight="skyblue">About</h2>
<h3>Quote of the day:</h3>
<twain-quote></twai... | {
"end_byte": 417,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/about/about.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/welcome/welcome.component.spec.ts_0_2609 | // #docplaster
import {ComponentFixture, inject, TestBed} from '@angular/core/testing';
import {UserService} from '../model/user.service';
import {WelcomeComponent} from './welcome.component';
// #docregion mock-user-service
class MockUserService {
isLoggedIn = true;
user = {name: 'Test User'};
}
// #enddocregion... | {
"end_byte": 2609,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/welcome/welcome.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/welcome/welcome.component.ts_0_573 | // #docregion
import {Component, OnInit, signal} from '@angular/core';
import {UserService} from '../model/user.service';
@Component({
standalone: true,
selector: 'app-welcome',
template: '<h3 class="welcome"><i>{{welcome()}}</i></h3>',
})
// #docregion class
export class WelcomeComponent implements OnInit {
w... | {
"end_byte": 573,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/welcome/welcome.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.no-testbed.spec.ts_0_1909 | import {Router} from '@angular/router';
import {DashboardComponent} from './dashboard.component';
import {Hero} from '../model/hero';
import {addMatchers} from '../../testing';
import {TestHeroService} from '../model/testing/test-hero.service';
class FakeRouter {
navigateByUrl(url: string) {
return url;
}
}
... | {
"end_byte": 1909,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.no-testbed.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.spec.ts_0_4176 | import {provideHttpClient} from '@angular/common/http';
import {HttpTestingController, provideHttpClientTesting} from '@angular/common/http/testing';
import {NO_ERRORS_SCHEMA} from '@angular/core';
import {TestBed, waitForAsync} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {Navigat... | {
"end_byte": 4176,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.css_0_468 | [class*='col-'] {
float: left;
}
*,
*::after,
*::before {
box-sizing: border-box;
}
h3 {
text-align: center;
margin-bottom: 0;
}
[class*='col-'] {
padding-right: 20px;
padding-bottom: 20px;
}
[class*='col-']:last-of-type {
padding-right: 0;
}
.grid {
margin: 0;
}
.col-1-4 {
width: 25%;
}
.grid-pad {
... | {
"end_byte": 468,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.css"
} |
angular/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.html_0_314 | <h2 highlight>{{ title }}</h2>
<div class="grid grid-pad">
<!-- #docregion dashboard-hero -->
@for (hero of heroes; track hero) {
<dashboard-hero
class="col-1-4"
[hero]="hero"
(selected)="gotoDetail($event)"
>
</dashboard-hero>
}
<!-- #enddocregion dashboard-hero -->
</div>
| {
"end_byte": 314,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.html"
} |
angular/adev/src/content/examples/testing/src/app/dashboard/dashboard-hero.component.css_0_428 | .hero {
padding: 20px;
position: relative;
text-align: center;
color: #eee;
max-height: 120px;
width: 100%;
min-width: 120px;
background-color: #607d8b;
border-radius: 2px;
}
.hero:hover {
background-color: #eee;
cursor: pointer;
color: #607d8b;
}
@media (max-width: 600px) {
.hero {
font... | {
"end_byte": 428,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/dashboard/dashboard-hero.component.css"
} |
angular/adev/src/content/examples/testing/src/app/dashboard/dashboard-hero.component.spec.ts_0_4957 | // #docplaster
import {DebugElement} from '@angular/core';
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {first} from 'rxjs/operators';
import {addMatchers, click} from '../../testing';
import {appProviders} from '../app.config';
imp... | {
"end_byte": 4957,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/dashboard/dashboard-hero.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/dashboard/dashboard-hero.component.ts_0_658 | // #docregion
import {Component, input, output} from '@angular/core';
import {UpperCasePipe} from '@angular/common';
import {Hero} from '../model/hero';
// #docregion component
@Component({
standalone: true,
selector: 'dashboard-hero',
template: `
<button type="button" (click)="click()" class="hero">
... | {
"end_byte": 658,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/dashboard/dashboard-hero.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.ts_0_1142 | // #docregion
import {Component, OnInit} from '@angular/core';
import {Router} from '@angular/router';
import {Hero} from '../model/hero';
import {HeroService} from '../model/hero.service';
import {sharedImports} from '../shared/shared';
import {DashboardHeroComponent} from './dashboard-hero.component';
@Component({... | {
"end_byte": 1142,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/dashboard/dashboard.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/twain/twain.component.ts_0_1314 | // #docregion
import {Component, OnInit, signal} from '@angular/core';
import {AsyncPipe} from '@angular/common';
import {sharedImports} from '../shared/shared';
import {Observable, of} from 'rxjs';
import {catchError, startWith} from 'rxjs/operators';
import {TwainService} from './twain.service';
@Component({
sta... | {
"end_byte": 1314,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/twain/twain.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/twain/twain.component.spec.ts_0_6129 | // #docplaster
import {fakeAsync, ComponentFixture, TestBed, tick, waitForAsync} from '@angular/core/testing';
import {asyncData, asyncError} from '../../testing';
import {Subject, defer, of, throwError} from 'rxjs';
import {last} from 'rxjs/operators';
import {TwainComponent} from './twain.component';
import {Twain... | {
"end_byte": 6129,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/twain/twain.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/twain/twain.component.marbles.spec.ts_0_3116 | // #docplaster
import {fakeAsync, ComponentFixture, TestBed, tick} from '@angular/core/testing';
// #docregion import-marbles
import {cold, getTestScheduler} from 'jasmine-marbles';
// #enddocregion import-marbles
import {TwainService} from './twain.service';
import {TwainComponent} from './twain.component';
describ... | {
"end_byte": 3116,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/twain/twain.component.marbles.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/twain/quote.ts_0_58 | export interface Quote {
id: number;
quote: string;
}
| {
"end_byte": 58,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/twain/quote.ts"
} |
angular/adev/src/content/examples/testing/src/app/twain/twain.data.ts_0_964 | import {Quote} from './quote';
export const QUOTES: Quote[] = [
'Always do right. This will gratify some people and astonish the rest.',
'I have never let my schooling interfere with my education.',
"Don't go around saying the world owes you a living. The world owes you nothing. It was here first.",
'Whenever ... | {
"end_byte": 964,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/twain/twain.data.ts"
} |
angular/adev/src/content/examples/testing/src/app/twain/twain.service.ts_0_1608 | // Mark Twain Quote service gets quotes from server
import {Injectable} from '@angular/core';
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {Observable, of, throwError, Observer} from 'rxjs';
import {concat, map, retryWhen, switchMap, take, tap} from 'rxjs/operators';
import {Quote} from ... | {
"end_byte": 1608,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/twain/twain.service.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/hero.service.spec.ts_0_7244 | import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
// Other imports
import {TestBed} from '@angular/core/testing';
import {HttpClient, HttpResponse, HttpErrorResponse} from '@angular/common/http';
import {asyncData, asyncError} from '../../testing/async-observable-helpers';
... | {
"end_byte": 7244,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/model/hero.service.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/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/testing/src/app/model/hero.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/user.service.ts_0_181 | import {Injectable, signal} from '@angular/core';
@Injectable({providedIn: 'root'})
export class UserService {
isLoggedIn = signal(true);
user = signal({name: 'Sam Spade'});
}
| {
"end_byte": 181,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/model/user.service.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/index.ts_0_88 | export * from './hero';
export * from './hero.service';
export * from './user.service';
| {
"end_byte": 88,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/model/index.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/hero.service.ts_0_3276 | import {HttpClient, HttpErrorResponse, HttpHeaders} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {catchError, map, tap} from 'rxjs/operators';
import {Hero} from './hero';
const httpOptions = {
headers: new HttpHeaders({'Content-Type': 'application/j... | {
"end_byte": 3276,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/model/hero.service.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/testing/http-client.spec.ts_0_5396 | // Http testing module and mocking controller
import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
// Other imports
import {TestBed} from '@angular/core/testing';
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {HttpHeaders} from '@angular/common/http... | {
"end_byte": 5396,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/model/testing/http-client.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/testing/test-hero.service.ts_0_1759 | import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {asyncData} from '../../../testing';
import {map} from 'rxjs/operators';
// re-export for tester convenience
export {Hero} from '../hero';
export {HeroService} from '../hero.service';
export {getTestHeroes} from './test-heroes';
impor... | {
"end_byte": 1759,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/model/testing/test-hero.service.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/testing/index.ts_0_37 | export * from './test-hero.service';
| {
"end_byte": 37,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/model/testing/index.ts"
} |
angular/adev/src/content/examples/testing/src/app/model/testing/test-heroes.ts_0_306 | import {Hero} from '../hero';
/** return fresh array of test heroes */
export function getTestHeroes(): Hero[] {
return [
{id: 41, name: 'Bob'},
{id: 42, name: 'Carol'},
{id: 43, name: 'Ted'},
{id: 44, name: 'Alice'},
{id: 45, name: 'Speedy'},
{id: 46, name: 'Stealthy'},
];
}
| {
"end_byte": 306,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/model/testing/test-heroes.ts"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-list.component.spec.ts_0_4782 | import {ComponentFixture, fakeAsync, TestBed, tick, waitForAsync} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {DebugElement} from '@angular/core';
import {Router} from '@angular/router';
import {addMatchers} from '../../testing';
import {HeroService} from '../model/hero.service... | {
"end_byte": 4782,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-list.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-list.component.css_0_1060 | .selected {
background-color: #cfd8dc !important;
color: white;
}
.heroes {
margin: 0 0 2em 0;
list-style-type: none;
padding: 0;
width: 15em;
}
.heroes li {
display: flex;
}
.heroes button {
flex: 1;
cursor: pointer;
position: relative;
left: 0;
background-color: #eee;
margin: 0.5em;
pad... | {
"end_byte": 1060,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-list.component.css"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-detail.component.ts_0_1665 | // #docplaster
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router, RouterLink} from '@angular/router';
import {Hero} from '../model/hero';
import {sharedImports} from '../shared/shared';
import {HeroDetailService} from './hero-detail.service';
// #docregion prototype
@Component({
stand... | {
"end_byte": 1665,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-detail.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-detail.component.css_0_465 | label {
display: inline-block;
width: 3em;
margin: 0.5em 0;
color: #607d8b;
font-weight: bold;
}
input {
height: 2em;
font-size: 1em;
padding-left: 0.4em;
}
button {
margin-top: 20px;
font-family: Arial, sans-serif;
background-color: #eee;
border: none;
padding: 5px 10px;
border-radius: 4px;... | {
"end_byte": 465,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-detail.component.css"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-detail.service.ts_0_818 | import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {map} from 'rxjs/operators';
import {Hero} from '../model/hero';
import {HeroService} from '../model/hero.service';
// #docregion prototype
@Injectable({providedIn: 'root'})
export class HeroDetailService {
constructor(private heroSer... | {
"end_byte": 818,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-detail.service.ts"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero.routes.ts_0_282 | import {HeroListComponent} from './hero-list.component';
import {HeroDetailComponent} from './hero-detail.component';
import {Routes} from '@angular/router';
export default [
{path: '', component: HeroListComponent},
{path: ':id', component: HeroDetailComponent},
] as Routes;
| {
"end_byte": 282,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero.routes.ts"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-detail.component.spec.ts_0_8907 | // #docplaster
import {HttpClient, HttpHandler, provideHttpClient} from '@angular/common/http';
import {HttpTestingController, provideHttpClientTesting} from '@angular/common/http/testing';
import {fakeAsync, TestBed, tick} from '@angular/core/testing';
import {provideRouter, Router} from '@angular/router';
import {Rou... | {
"end_byte": 8907,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-detail.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-detail.component.spec.ts_8908_10075 | async function createComponent(id: number) {
harness = await RouterTestingHarness.create();
component = await harness.navigateByUrl(`/heroes/${id}`, HeroDetailComponent);
page = new Page();
const request = TestBed.inject(HttpTestingController).expectOne(`api/heroes/?id=${id}`);
const hero = getTestHeroes().f... | {
"end_byte": 10075,
"start_byte": 8908,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-detail.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-detail.component.html_0_419 | <!-- #docregion -->
@if (hero) {
<div>
<h2>
<span>{{ hero.name | titlecase }}</span> Details
</h2>
<div><span>id: </span>{{ hero.id }}</div>
<div>
<label for="name">name: </label>
<input id="name" [(ngModel)]="hero.name" placeholder="name" />
</div>
<button type="button" (cli... | {
"end_byte": 419,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-detail.component.html"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-list.component.ts_0_836 | import {Component} from '@angular/core';
import {AsyncPipe} from '@angular/common';
import {Router} from '@angular/router';
import {Observable} from 'rxjs';
import {Hero} from '../model/hero';
import {HeroService} from '../model/hero.service';
import {sharedImports} from '../shared/shared';
@Component({
standalone... | {
"end_byte": 836,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-list.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/hero/hero-list.component.html_0_341 | <h2 highlight="gold">My Heroes</h2>
<ul class="heroes">
@for (hero of heroes | async; track hero) {
<li>
<button [class.selected]="hero === selectedHero" type="button" (click)="onSelect(hero)">
<span class="badge">{{ hero.id }}</span>
<span class="name">{{ hero.name }}</span>
</button>... | {
"end_byte": 341,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/hero/hero-list.component.html"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner.component.detect-changes.spec.ts_0_1658 | // #docplaster
// #docregion
// #docregion import-ComponentFixtureAutoDetect
import {ComponentFixtureAutoDetect} from '@angular/core/testing';
// #enddocregion import-ComponentFixtureAutoDetect
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {BannerComponent} from './banner.component';
describ... | {
"end_byte": 1658,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner.component.detect-changes.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner.component.ts_0_324 | import {Component, signal} from '@angular/core';
// #docregion component
@Component({
standalone: true,
selector: 'app-banner',
template: '<h1>{{title()}}</h1>',
styles: ['h1 { color: green; font-size: 350%}'],
})
export class BannerComponent {
title = signal('Test Tour of Heroes');
}
// #enddocregion compon... | {
"end_byte": 324,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner-initial.component.spec.ts_0_3522 | // #docplaster
// #docregion import-debug-element
import {DebugElement} from '@angular/core';
// #enddocregion import-debug-element
// #docregion v1
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
// #enddocregion v1
// #docregion import-by
import {By} from '@angular/platform-browser';
/... | {
"end_byte": 3522,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner-initial.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner-external.component.ts_0_349 | // #docplaster
// #docregion
import {Component} from '@angular/core';
// #docregion metadata
@Component({
standalone: true,
selector: 'app-banner',
templateUrl: './banner-external.component.html',
styleUrls: ['./banner-external.component.css'],
})
// #enddocregion metadata
export class BannerComponent {
titl... | {
"end_byte": 349,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner-external.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner.component.spec.ts_0_1605 | // #docplaster
// #docregion
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {BannerComponent} from './banner.component';
describe('BannerComponent (inline template)', () => {
// #docregion setup
let component: BannerComponent;
let fixture: ComponentFixture<BannerComponent>;
let h1: HT... | {
"end_byte": 1605,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner-external.component.css_0_42 | h1 {
color: green;
font-size: 350%;
}
| {
"end_byte": 42,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner-external.component.css"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner-initial.component.ts_0_253 | // BannerComponent as initially generated by the CLI
// #docregion
import {Component} from '@angular/core';
@Component({
standalone: true,
selector: 'app-banner',
template: '<p>banner works!</p>',
styles: [],
})
export class BannerComponent {}
| {
"end_byte": 253,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner-initial.component.ts"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner-external.component.spec.ts_0_2297 | // #docplaster
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {BannerComponent} from './banner-external.component';
describe('BannerComponent (external files)', () => {
let component: BannerComponent;
let fixture: ComponentFixture<BannerComponent>;
let h1: HTMLElement;
describe('setu... | {
"end_byte": 2297,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner-external.component.spec.ts"
} |
angular/adev/src/content/examples/testing/src/app/banner/banner-external.component.html_0_21 | <h1>{{ title }}</h1>
| {
"end_byte": 21,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/app/banner/banner-external.component.html"
} |
angular/adev/src/content/examples/testing/src/testing/jasmine-matchers.d.ts_0_169 | // TODO: fix
// declare namespace jasmine {
// interface Matchers<T> {
// toHaveText(actual: any, expectationFailOutput?: any): jasmine.CustomMatcher;
// }
// }
| {
"end_byte": 169,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/testing/jasmine-matchers.d.ts"
} |
angular/adev/src/content/examples/testing/src/testing/jasmine-matchers.ts_0_1334 | /// <reference path="./jasmine-matchers.d.ts" />
//// Jasmine Custom Matchers ////
// Be sure to extend jasmine-matchers.d.ts when adding matchers
export function addMatchers(): void {
jasmine.addMatchers({
toHaveText,
});
}
function toHaveText(): jasmine.CustomMatcher {
return {
compare: (
actu... | {
"end_byte": 1334,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/testing/jasmine-matchers.ts"
} |
angular/adev/src/content/examples/testing/src/testing/async-observable-helpers.ts_0_890 | /*
* Mock async observables that return asynchronously.
* The observable either emits once and completes or errors.
*
* Must call `tick()` when test with `fakeAsync()`.
*
* THE FOLLOWING DON'T WORK
* Using `of().delay()` triggers TestBed errors;
* see https://github.com/angular/angular/issues/10127 .
*
* Usin... | {
"end_byte": 890,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/testing/async-observable-helpers.ts"
} |
angular/adev/src/content/examples/testing/src/testing/index.ts_0_948 | import {DebugElement} from '@angular/core';
import {ComponentFixture, tick} from '@angular/core/testing';
export * from './async-observable-helpers';
export * from './jasmine-matchers';
///// Short utilities /////
/** Wait a tick, then detect changes */
export function advance(f: ComponentFixture<any>): void {
tic... | {
"end_byte": 948,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/testing/src/testing/index.ts"
} |
angular/adev/src/content/examples/ssr/readme.md_0_320 | # Instructions for Angular SSR Example Download
This is the downloaded sample code for the [Angular SSR (Standalone) guide](https://angular.io/guide/ssr).
## Install and Run
1. `npm install` to install the `node_module` packages
2. `ng serve` to launch the dev-server
3. Launch the browser to `http://localhost:4200`
| {
"end_byte": 320,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/readme.md"
} |
angular/adev/src/content/examples/ssr/BUILD.bazel_0_84 | package(default_visibility = ["//visibility:public"])
exports_files(["server.ts"])
| {
"end_byte": 84,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/BUILD.bazel"
} |
angular/adev/src/content/examples/ssr/server.ts_0_1846 | // #docplaster
import {APP_BASE_HREF} from '@angular/common';
import {CommonEngine} from '@angular/ssr/node';
import express from 'express';
import {fileURLToPath} from 'node:url';
import {dirname, join, resolve} from 'node:path';
import bootstrap from './src/main.server';
// The Express app is exported so that it ca... | {
"end_byte": 1846,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/server.ts"
} |
angular/adev/src/content/examples/ssr/e2e/src/app.e2e-spec.ts_0_1074 | import {browser, by, element, ElementArrayFinder, ElementFinder, logging} from 'protractor';
class Hero {
constructor(
public id: number,
public name: string,
) {}
// Factory methods
// Hero from string formatted as '<id> <name>'.
static fromString(s: string): Hero {
return new Hero(+s.substrin... | {
"end_byte": 1074,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/ssr/e2e/src/app.e2e-spec.ts_1076_9607 | describe('Universal', () => {
const expectedH1 = 'Tour of Heroes';
const expectedTitle = `${expectedH1}`;
const targetHero = {id: 15, name: 'Magneta'};
const targetHeroDashboardIndex = 2;
const nameSuffix = 'X';
const newHeroName = targetHero.name + nameSuffix;
afterEach(async () => {
// Assert that ... | {
"end_byte": 9607,
"start_byte": 1076,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/ssr/e2e/src/app.e2e-spec.ts_9611_11461 | async function expectHeading(hLevel: number, expectedText: string): Promise<void> {
const hTag = `h${hLevel}`;
const hText = await element(by.css(hTag)).getText();
expect(hText).toEqual(expectedText, hTag);
}
function getHeroAEltById(id: number): ElementFinder {
const spanForId = element(by.cssCont... | {
"end_byte": 11461,
"start_byte": 9611,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/ssr/src/index.html_0_300 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tour of Heroes</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": 300,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/index.html"
} |
angular/adev/src/content/examples/ssr/src/main.ts_0_241 | import {bootstrapApplication} from '@angular/platform-browser';
import {AppComponent} from './app/app.component';
import {appConfig} from './app/app.config';
bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err));
| {
"end_byte": 241,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/main.ts"
} |
angular/adev/src/content/examples/ssr/src/main.server.ts_0_257 | import {bootstrapApplication} from '@angular/platform-browser';
import {AppComponent} from './app/app.component';
import {config} from './app/app.config.server';
const bootstrap = () => bootstrapApplication(AppComponent, config);
export default bootstrap;
| {
"end_byte": 257,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/main.server.ts"
} |
angular/adev/src/content/examples/ssr/src/app/app.component.html_0_174 | <h1>{{title}}</h1>
<nav>
<a routerLink="/dashboard">Dashboard</a>
<a routerLink="/heroes">Heroes</a>
</nav>
<router-outlet></router-outlet>
<app-messages></app-messages>
| {
"end_byte": 174,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/app.component.html"
} |
angular/adev/src/content/examples/ssr/src/app/message.service.ts_0_240 | 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": 240,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/message.service.ts"
} |
angular/adev/src/content/examples/ssr/src/app/in-memory-data.service.ts_0_984 | import {Injectable} from '@angular/core';
import {InMemoryDbService} from 'angular-in-memory-web-api';
import {Hero} from './hero';
@Injectable({
providedIn: 'root',
})
export class InMemoryDataService implements InMemoryDbService {
createDb() {
const heroes = [
{id: 12, name: 'Dr. Nice'},
{id: 13,... | {
"end_byte": 984,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/in-memory-data.service.ts"
} |
angular/adev/src/content/examples/ssr/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/ssr/src/app/hero.ts"
} |
angular/adev/src/content/examples/ssr/src/app/app.config.server.ts_0_337 | import {mergeApplicationConfig, ApplicationConfig} from '@angular/core';
import {provideServerRendering} from '@angular/platform-server';
import {appConfig} from './app.config';
const serverConfig: ApplicationConfig = {
providers: [provideServerRendering()],
};
export const config = mergeApplicationConfig(appConfig... | {
"end_byte": 337,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/app.config.server.ts"
} |
angular/adev/src/content/examples/ssr/src/app/mock-heroes.ts_0_328 | 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, name: 'Tornad... | {
"end_byte": 328,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/mock-heroes.ts"
} |
angular/adev/src/content/examples/ssr/src/app/app.routes.ts_0_494 | import {Routes} from '@angular/router';
import {DashboardComponent} from './dashboard/dashboard.component';
import {HeroesComponent} from './heroes/heroes.component';
import {HeroDetailComponent} from './hero-detail/hero-detail.component';
export const routes: Routes = [
{path: '', redirectTo: '/dashboard', pathMat... | {
"end_byte": 494,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/app.routes.ts"
} |
angular/adev/src/content/examples/ssr/src/app/app.component.ts_0_772 | import {Component} from '@angular/core';
import {RouterLink, RouterOutlet} from '@angular/router';
import {PLATFORM_ID, APP_ID, Inject} from '@angular/core';
import {isPlatformBrowser} from '@angular/common';
import {MessagesComponent} from './messages/messages.component';
@Component({
standalone: true,
selector... | {
"end_byte": 772,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/app.component.ts"
} |
angular/adev/src/content/examples/ssr/src/app/app.config.ts_0_1149 | // #docplaster
import {importProvidersFrom} from '@angular/core';
import {provideProtractorTestingSupport} from '@angular/platform-browser';
import {provideClientHydration} from '@angular/platform-browser';
import {ApplicationConfig} from '@angular/core';
import {provideRouter} from '@angular/router';
import {provideHt... | {
"end_byte": 1149,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/app.config.ts"
} |
angular/adev/src/content/examples/ssr/src/app/app.component.css_0_378 | /* AppComponent's private CSS styles */
h1 {
font-size: 1.2em;
margin-bottom: 0;
}
nav a {
padding: 5px 10px;
text-decoration: none;
margin-top: 10px;
display: inline-block;
background-color: #eee;
border-radius: 4px;
}
nav a:visited, a:link {
color: #334953;
}
nav a:hover {
color: #039be5;
backgr... | {
"end_byte": 378,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/app.component.css"
} |
angular/adev/src/content/examples/ssr/src/app/hero.service.ts_0_3957 | import {Injectable} from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import {Observable, of} from 'rxjs';
import {catchError, map, tap} from 'rxjs/operators';
import {Hero} from './hero';
import {MessageService} from './message.service';
@Injectable({providedIn: 'root'})
export cla... | {
"end_byte": 3957,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/hero.service.ts"
} |
angular/adev/src/content/examples/ssr/src/app/messages/messages.component.html_0_255 | <div *ngIf="messageService.messages.length">
<h2>Messages</h2>
<button type="button"
class="clear"
(click)="messageService.clear()">clear</button>
<div *ngFor='let message of messageService.messages'> {{message}} </div>
</div>
| {
"end_byte": 255,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/messages/messages.component.html"
} |
angular/adev/src/content/examples/ssr/src/app/messages/messages.component.ts_0_407 | import {Component} from '@angular/core';
import {NgFor, NgIf} from '@angular/common';
import {MessageService} from '../message.service';
@Component({
standalone: true,
selector: 'app-messages',
templateUrl: './messages.component.html',
imports: [NgFor, NgIf],
styleUrls: ['./messages.component.css'],
})
expo... | {
"end_byte": 407,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/messages/messages.component.ts"
} |
angular/adev/src/content/examples/ssr/src/app/messages/messages.component.css_0_375 | /* MessagesComponent's private CSS styles */
h2 {
color: red;
font-family: Arial, Helvetica, sans-serif;
font-weight: lighter;
}
button.clear {
font-family: Arial, sans-serif;
color: #333;
background-color: #eee;
margin-bottom: 12px;
border: none;
padding: 5px 10px;
border-radius: 4px;
cursor: po... | {
"end_byte": 375,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/messages/messages.component.css"
} |
angular/adev/src/content/examples/ssr/src/app/heroes/heroes.component.css_0_1177 | /* HeroesComponent's private CSS styles */
.heroes {
margin: 0 0 2em 0;
list-style-type: none;
padding: 0;
width: 15em;
}
.heroes li {
position: relative;
cursor: pointer;
background-color: #EEE;
margin: .5em;
padding: .3em 0;
height: 1.6em;
border-radius: 4px;
}
.heroes li:hover {
color: #607... | {
"end_byte": 1177,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/heroes/heroes.component.css"
} |
angular/adev/src/content/examples/ssr/src/app/heroes/heroes.component.html_0_556 | <h2>My Heroes</h2>
<div>
<label for="name">Hero name:
<input id="name" #heroName />
</label>
<!-- (click) passes input value to add() and then clears the input -->
<button type="button" (click)="add(heroName.value); heroName.value=''">
add
</button>
</div>
<ul class="heroes">
<li *ngFor="let hero ... | {
"end_byte": 556,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/heroes/heroes.component.html"
} |
angular/adev/src/content/examples/ssr/src/app/heroes/heroes.component.ts_0_1002 | import {Component, OnInit} from '@angular/core';
import {NgFor} from '@angular/common';
import {RouterLink} from '@angular/router';
import {Hero} from '../hero';
import {HeroService} from '../hero.service';
@Component({
standalone: true,
selector: 'app-heroes',
templateUrl: './heroes.component.html',
imports:... | {
"end_byte": 1002,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/heroes/heroes.component.ts"
} |
angular/adev/src/content/examples/ssr/src/app/hero-detail/hero-detail.component.ts_0_1064 | import {Component, OnInit, Input} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Location, NgIf, UpperCasePipe} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {Hero} from '../hero';
import {HeroService} from '../hero.service';
@Component({
standalone: true,... | {
"end_byte": 1064,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/hero-detail/hero-detail.component.ts"
} |
angular/adev/src/content/examples/ssr/src/app/hero-detail/hero-detail.component.css_0_510 | /* HeroDetailComponent's private CSS styles */
label {
display: inline-block;
width: 3em;
margin: .5em 0;
color: #607D8B;
font-weight: bold;
}
input {
height: 2em;
font-size: 1em;
padding-left: .4em;
}
button {
margin-top: 20px;
font-family: Arial, sans-serif;
background-color: #eee;
border: non... | {
"end_byte": 510,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/hero-detail/hero-detail.component.css"
} |
angular/adev/src/content/examples/ssr/src/app/hero-detail/hero-detail.component.html_0_354 | <div *ngIf="hero">
<h2>{{hero.name | uppercase}} Details</h2>
<div><span>id: </span>{{hero.id}}</div>
<div>
<label for="name">name:
<input id="name" [(ngModel)]="hero.name" placeholder="name"/>
</label>
</div>
<button type="button" (click)="goBack()">go back</button>
<button type="button" (cli... | {
"end_byte": 354,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/hero-detail/hero-detail.component.html"
} |
angular/adev/src/content/examples/ssr/src/app/hero-search/hero-search.component.html_0_335 | <div id="search-component">
<h4><label for="search-box">Hero Search</label></h4>
<input #searchBox id="search-box" (input)="search(searchBox.value)" />
<ul class="search-result">
<li *ngFor="let hero of heroes$ | async" >
<a routerLink="/detail/{{hero.id}}">
{{hero.name}}
</a>
</li>
... | {
"end_byte": 335,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/hero-search/hero-search.component.html"
} |
angular/adev/src/content/examples/ssr/src/app/hero-search/hero-search.component.ts_0_1243 | import {Component, OnInit} from '@angular/core';
import {AsyncPipe, NgFor} from '@angular/common';
import {RouterLink} from '@angular/router';
import {Observable, Subject} from 'rxjs';
import {debounceTime, distinctUntilChanged, switchMap} from 'rxjs/operators';
import {Hero} from '../hero';
import {HeroService} fro... | {
"end_byte": 1243,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/hero-search/hero-search.component.ts"
} |
angular/adev/src/content/examples/ssr/src/app/hero-search/hero-search.component.css_0_611 | /* HeroSearch private styles */
.search-result li {
border-bottom: 1px solid gray;
border-left: 1px solid gray;
border-right: 1px solid gray;
width: 195px;
height: 16px;
padding: 5px;
background-color: white;
cursor: pointer;
list-style-type: none;
}
.search-result li:hover {
background-color: #607... | {
"end_byte": 611,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/hero-search/hero-search.component.css"
} |
angular/adev/src/content/examples/ssr/src/app/dashboard/dashboard.component.css_0_917 | /* DashboardComponent's private CSS styles */
[class*='col-'] {
float: left;
padding-right: 20px;
padding-bottom: 20px;
}
[class*='col-']:last-of-type {
padding-right: 0;
}
a {
text-decoration: none;
}
*, *::after, *::before {
box-sizing: border-box;
}
h3 {
text-align: center;
margin-bottom: 0;
}
h4 {
... | {
"end_byte": 917,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/dashboard/dashboard.component.css"
} |
angular/adev/src/content/examples/ssr/src/app/dashboard/dashboard.component.html_0_258 | <h3>Top Heroes</h3>
<div class="grid grid-pad">
<a *ngFor="let hero of heroes" class="col-1-4"
routerLink="/detail/{{hero.id}}">
<div class="module hero">
<h4>{{hero.name}}</h4>
</div>
</a>
</div>
<app-hero-search></app-hero-search>
| {
"end_byte": 258,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/dashboard/dashboard.component.html"
} |
angular/adev/src/content/examples/ssr/src/app/dashboard/dashboard.component.ts_0_780 | import {Component, OnInit} from '@angular/core';
import {NgFor} from '@angular/common';
import {RouterLink} from '@angular/router';
import {Hero} from '../hero';
import {HeroSearchComponent} from '../hero-search/hero-search.component';
import {HeroService} from '../hero.service';
@Component({
standalone: true,
se... | {
"end_byte": 780,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/ssr/src/app/dashboard/dashboard.component.ts"
} |
angular/adev/src/content/examples/elements/BUILD.bazel_0_172 | package(default_visibility = ["//visibility:public"])
exports_files([
"src/app/app.component.ts",
"src/app/popup.component.ts",
"src/app/popup.service.ts",
])
| {
"end_byte": 172,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/elements/BUILD.bazel"
} |
angular/adev/src/content/examples/elements/e2e/src/app.e2e-spec.ts_0_2773 | import {browser, by, element, ElementFinder, ExpectedConditions as EC} from 'protractor';
describe('Elements', () => {
const messageInput = element(by.css('input'));
const popupButtons = element.all(by.css('button'));
// Helpers
const click = async (elem: ElementFinder) => {
// Waiting for the element to ... | {
"end_byte": 2773,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/elements/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/elements/src/index.html_0_253 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<base href="/">
<title>Elements</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<app-root></app-root>
</body>
</html>
| {
"end_byte": 253,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/elements/src/index.html"
} |
angular/adev/src/content/examples/elements/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/elements/src/main.ts"
} |
angular/adev/src/content/examples/elements/src/app/popup.service.ts_0_1769 | import {ApplicationRef, createComponent, EnvironmentInjector, Injectable} from '@angular/core';
import {NgElement, WithProperties} from '@angular/elements';
import {PopupComponent} from './popup.component';
@Injectable()
export class PopupService {
constructor(
private injector: EnvironmentInjector,
private ... | {
"end_byte": 1769,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/elements/src/app/popup.service.ts"
} |
angular/adev/src/content/examples/elements/src/app/popup.component.ts_0_1359 | // #docregion
import {Component, EventEmitter, HostBinding, Input, Output} from '@angular/core';
import {animate, state, style, transition, trigger} from '@angular/animations';
@Component({
standalone: true,
selector: 'my-popup',
template: `
<span>Popup: {{ message }}</span>
<button type="button" (click)... | {
"end_byte": 1359,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/elements/src/app/popup.component.ts"
} |
angular/adev/src/content/examples/elements/src/app/app.component.ts_0_918 | import {Component, Injector} from '@angular/core';
import {createCustomElement} from '@angular/elements';
import {PopupComponent} from './popup.component';
import {PopupService} from './popup.service';
@Component({
standalone: true,
selector: 'app-root',
template: `
<input #input value="Message" />
<butt... | {
"end_byte": 918,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/elements/src/app/app.component.ts"
} |
angular/adev/src/content/examples/styleguide/BUILD.bazel_0_3300 | package(default_visibility = ["//visibility:public"])
exports_files([
"src/01-01/app/app.component.ts",
"src/01-01/app/app.module.ts",
"src/01-01/app/heroes/hero.component.avoid.ts",
"src/01-01/app/heroes/heroes.component.ts",
"src/01-01/app/heroes/shared/hero.model.ts",
"src/01-01/app/heroes/s... | {
"end_byte": 3300,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/styleguide/BUILD.bazel"
} |
angular/adev/src/content/examples/styleguide/e2e/src/app.e2e-spec.ts_0_4111 | import {browser, element, by} from 'protractor';
describe('Style Guide', () => {
it('01-01', async () => {
await browser.get('#/01-01');
const pre = element(by.tagName('toh-heroes > pre'));
expect(await pre.getText()).toContain('Bombasto');
expect(await pre.getText()).toContain('Tornado');
expec... | {
"end_byte": 4111,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/styleguide/e2e/src/app.e2e-spec.ts"
} |
angular/adev/src/content/examples/styleguide/src/index.html_0_309 | <!DOCTYPE html>
<!-- #docregion -->
<html lang="en">
<head>
<base href="/">
<title>Style Guide Sample</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<app-root></app-root>
</body>
</html>
<!-- #enddocregion -->
| {
"end_byte": 309,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/adev/src/content/examples/styleguide/src/index.html"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.