Skip to content

Commit c2e1311

Browse files
gkalpakmatsko
authored andcommitted
refactor(aio): rename method (loadContainingCustomElements --> loadContainedCustomElements) (angular#23944)
PR Close angular#23944
1 parent 7866684 commit c2e1311

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

aio/scripts/_payload-limits.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"master": {
44
"uncompressed": {
55
"runtime": 2768,
6-
"main": 475857,
6+
"main": 475855,
77
"polyfills": 38453,
88
"prettify": 14913
99
}

aio/src/app/app.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ function createTestingModule(initialUrl: string, mode: string = 'stable') {
13061306
}
13071307

13081308
class TestElementsLoader {
1309-
loadContainingCustomElements = jasmine.createSpy('loadContainingCustomElements')
1309+
loadContainedCustomElements = jasmine.createSpy('loadContainedCustomElements')
13101310
.and.returnValue(of(undefined));
13111311

13121312
loadCustomElement = jasmine.createSpy('loadCustomElement')

aio/src/app/custom-elements/elements-loader.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('ElementsLoader', () => {
3333
elementsLoader = injector.get(ElementsLoader);
3434
});
3535

36-
describe('loadContainingCustomElements()', () => {
36+
describe('loadContainedCustomElements()', () => {
3737
let loadCustomElementSpy: jasmine.Spy;
3838

3939
beforeEach(() => loadCustomElementSpy = spyOn(elementsLoader, 'loadCustomElement'));
@@ -47,7 +47,7 @@ describe('ElementsLoader', () => {
4747
<element-b-selector></element-b-selector>
4848
`;
4949

50-
elementsLoader.loadContainingCustomElements(hostEl);
50+
elementsLoader.loadContainedCustomElements(hostEl);
5151
flushMicrotasks();
5252

5353
expect(loadCustomElementSpy).toHaveBeenCalledTimes(2);
@@ -63,7 +63,7 @@ describe('ElementsLoader', () => {
6363
<element-b-selector></element-b-selector>
6464
`;
6565

66-
elementsLoader.loadContainingCustomElements(hostEl);
66+
elementsLoader.loadContainedCustomElements(hostEl);
6767
flushMicrotasks();
6868

6969
expect(loadCustomElementSpy).toHaveBeenCalledTimes(1);
@@ -80,7 +80,7 @@ describe('ElementsLoader', () => {
8080
`;
8181

8282
const log: any[] = [];
83-
elementsLoader.loadContainingCustomElements(hostEl).subscribe(
83+
elementsLoader.loadContainedCustomElements(hostEl).subscribe(
8484
v => log.push(`emitted: ${v}`),
8585
e => log.push(`errored: ${e}`),
8686
() => log.push('completed'),
@@ -108,7 +108,7 @@ describe('ElementsLoader', () => {
108108
`;
109109

110110
const log: any[] = [];
111-
elementsLoader.loadContainingCustomElements(hostEl).subscribe(
111+
elementsLoader.loadContainedCustomElements(hostEl).subscribe(
112112
v => log.push(`emitted: ${v}`),
113113
e => log.push(`errored: ${e}`),
114114
() => log.push('completed'),

aio/src/app/custom-elements/elements-loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class ElementsLoader {
2626
* the browser. Custom elements that are registered will be removed from the list of unregistered
2727
* elements so that they will not be queried in subsequent calls.
2828
*/
29-
loadContainingCustomElements(element: HTMLElement): Observable<void> {
29+
loadContainedCustomElements(element: HTMLElement): Observable<void> {
3030
const unregisteredSelectors = Array.from(this.elementsToLoad.keys())
3131
.filter(s => element.querySelector(s));
3232

aio/src/app/custom-elements/lazy-custom-element.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('LazyCustomElementComponent', () => {
1111

1212
beforeEach(() => {
1313
mockElementsLoader = jasmine.createSpyObj<ElementsLoader>('ElementsLoader', [
14-
'loadContainingCustomElements',
14+
'loadContainedCustomElements',
1515
'loadCustomElement',
1616
]);
1717

aio/src/app/layout/doc-viewer/doc-viewer.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ describe('DocViewerComponent', () => {
300300

301301
beforeEach(() => {
302302
const elementsLoader = TestBed.get(ElementsLoader) as MockElementsLoader;
303-
loadElementsSpy = elementsLoader.loadContainingCustomElements.and.returnValue(of(undefined));
303+
loadElementsSpy = elementsLoader.loadContainedCustomElements.and.returnValue(of(undefined));
304304
prepareTitleAndTocSpy = spyOn(docViewer, 'prepareTitleAndToc');
305305
swapViewsSpy = spyOn(docViewer, 'swapViews').and.returnValue(of(undefined));
306306
});

aio/src/app/layout/doc-viewer/doc-viewer.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class DocViewerComponent implements OnDestroy {
136136
// and is considered to be safe.
137137
tap(() => this.nextViewContainer.innerHTML = doc.contents || ''),
138138
tap(() => addTitleAndToc = this.prepareTitleAndToc(this.nextViewContainer, doc.id)),
139-
switchMap(() => this.elementsLoader.loadContainingCustomElements(this.nextViewContainer)),
139+
switchMap(() => this.elementsLoader.loadContainedCustomElements(this.nextViewContainer)),
140140
tap(() => this.docReady.emit()),
141141
switchMap(() => this.swapViews(addTitleAndToc)),
142142
tap(() => this.docRendered.emit()),

aio/src/testing/doc-viewer-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export class MockTocService {
5656
}
5757

5858
export class MockElementsLoader {
59-
loadContainingCustomElements =
60-
jasmine.createSpy('MockElementsLoader#loadContainingCustomElements');
59+
loadContainedCustomElements =
60+
jasmine.createSpy('MockElementsLoader#loadContainedCustomElements');
6161
}
6262

6363
@NgModule({

0 commit comments

Comments
 (0)