style(docs-infra): fix docs examples for tslint rule `semicolon` (#38143)
This commit updates the docs examples to be compatible with the `semicolon` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143
This commit is contained in:
parent
7c0f11789b
commit
77f38d3be1
|
@ -84,7 +84,7 @@ export class AppComponent implements OnInit {
|
|||
}
|
||||
|
||||
resetList() {
|
||||
this.resetItems()
|
||||
this.resetItems();
|
||||
this.itemsWithTrackByCountReset = 0;
|
||||
this.itemsNoTrackByCount = ++this.itemsNoTrackByCount;
|
||||
}
|
||||
|
|
|
@ -22,5 +22,5 @@ export function runnersUpFactory(take: number) {
|
|||
.join(', ');
|
||||
// #docregion factory-synopsis
|
||||
};
|
||||
};
|
||||
}
|
||||
// #enddocregion factory-synopsis
|
||||
|
|
|
@ -107,7 +107,7 @@ export class OldLogger {
|
|||
logs: string[] = [];
|
||||
log(message: string) {
|
||||
throw new Error('Should not call the old logger!');
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -14,7 +14,7 @@ describe('Elements', () => {
|
|||
const waitForText = (elem: ElementFinder) => {
|
||||
// Waiting for the element to have some text, makes the tests less flaky.
|
||||
browser.wait(async () => /\S/.test(await elem.getText()), 5000);
|
||||
}
|
||||
};
|
||||
|
||||
beforeEach(() => browser.get(''));
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ function expectFormIsInvalid() {
|
|||
|
||||
function triggerAlterEgoValidation() {
|
||||
// alterEgo has updateOn set to 'blur', click outside of the input to trigger the blur event
|
||||
element(by.css('app-root')).click()
|
||||
element(by.css('app-root')).click();
|
||||
}
|
||||
|
||||
function waitForAlterEgoValidation() {
|
||||
|
|
|
@ -19,7 +19,7 @@ export const identityRevealedValidator: ValidatorFn = (control: FormGroup): Vali
|
|||
})
|
||||
export class IdentityRevealedValidatorDirective implements Validator {
|
||||
validate(control: AbstractControl): ValidationErrors {
|
||||
return identityRevealedValidator(control)
|
||||
return identityRevealedValidator(control);
|
||||
}
|
||||
}
|
||||
// #enddocregion cross-validation-directive
|
||||
|
|
|
@ -30,9 +30,9 @@ export class HeroTaxReturnComponent {
|
|||
onCanceled() {
|
||||
this.flashMessage('Canceled');
|
||||
this.heroTaxReturnService.restoreTaxReturn();
|
||||
};
|
||||
}
|
||||
|
||||
onClose() { this.close.emit(); };
|
||||
onClose() { this.close.emit(); }
|
||||
|
||||
onSaved() {
|
||||
this.flashMessage('Saved');
|
||||
|
|
|
@ -12,7 +12,7 @@ export interface RequestCacheEntry {
|
|||
// #docregion request-cache
|
||||
export abstract class RequestCache {
|
||||
abstract get(req: HttpRequest<any>): HttpResponse<any> | undefined;
|
||||
abstract put(req: HttpRequest<any>, response: HttpResponse<any>): void
|
||||
abstract put(req: HttpRequest<any>, response: HttpResponse<any>): void;
|
||||
}
|
||||
// #enddocregion request-cache
|
||||
|
||||
|
|
|
@ -97,11 +97,11 @@ describe('NgModule-example', function () {
|
|||
|
||||
newContactButton.click().then(function () {
|
||||
input.click();
|
||||
nextButton.click()
|
||||
nextButton.click();
|
||||
expect(contacts.validationError.getText()).toBe('Name is required.');
|
||||
input.click();
|
||||
contacts.input.sendKeys('Watson');
|
||||
saveButton.click()
|
||||
saveButton.click();
|
||||
expect(contacts.contactNameHeader.getText()).toBe('Awesome Watson');
|
||||
|
||||
});
|
||||
|
|
|
@ -6,4 +6,4 @@ export const CRISES: Crisis[] = [
|
|||
{ id: 2, name: 'Sky Rains Great White Sharks' },
|
||||
{ id: 3, name: 'Giant Asteroid Heading For Earth' },
|
||||
{ id: 4, name: 'Procrastinators Meeting Delayed Again' },
|
||||
]
|
||||
];
|
||||
|
|
|
@ -19,5 +19,5 @@ export class DialogService {
|
|||
const confirmation = window.confirm(message || 'Is it OK?');
|
||||
|
||||
return of(confirmation);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ export class FilterTextService {
|
|||
match = true;
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
return match;
|
||||
});
|
||||
filteredList = filtered;
|
||||
|
|
|
@ -51,7 +51,7 @@ export class MasterService {
|
|||
export class ReversePipe implements PipeTransform {
|
||||
transform(s: string) {
|
||||
let r = '';
|
||||
for (let i = s.length; i; ) { r += s[--i]; };
|
||||
for (let i = s.length; i; ) { r += s[--i]; }
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,5 +139,5 @@ class Page {
|
|||
// Get the component's injected router navigation spy
|
||||
const routerSpy = fixture.debugElement.injector.get(Router);
|
||||
this.navSpy = routerSpy.navigate as jasmine.Spy;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import { WelcomeComponent } from './welcome.component';
|
|||
class MockUserService {
|
||||
isLoggedIn = true;
|
||||
user = { name: 'Test User'};
|
||||
};
|
||||
}
|
||||
// #enddocregion mock-user-service
|
||||
|
||||
describe('WelcomeComponent (class only)', () => {
|
||||
|
|
|
@ -120,7 +120,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
|
|||
let hTag = `h${hLevel}`;
|
||||
let hText = element(by.css(hTag)).getText();
|
||||
expect(hText).toEqual(expectedText, hTag);
|
||||
};
|
||||
}
|
||||
|
||||
function getPageElts() {
|
||||
return {
|
||||
|
|
|
@ -120,7 +120,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
|
|||
let hTag = `h${hLevel}`;
|
||||
let hText = element(by.css(hTag)).getText();
|
||||
expect(hText).toEqual(expectedText, hTag);
|
||||
};
|
||||
}
|
||||
|
||||
function getPageElts() {
|
||||
return {
|
||||
|
|
|
@ -124,7 +124,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
|
|||
let hTag = `h${hLevel}`;
|
||||
let hText = element(by.css(hTag)).getText();
|
||||
expect(hText).toEqual(expectedText, hTag);
|
||||
};
|
||||
}
|
||||
|
||||
function getPageElts() {
|
||||
return {
|
||||
|
|
|
@ -164,7 +164,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
|
|||
let hTag = `h${hLevel}`;
|
||||
let hText = element(by.css(hTag)).getText();
|
||||
expect(hText).toEqual(expectedText, hTag);
|
||||
};
|
||||
}
|
||||
|
||||
function getHeroLiEltById(id: number) {
|
||||
let spanForId = element(by.cssContainingText('li span.badge', id.toString()));
|
||||
|
|
|
@ -286,7 +286,7 @@ function expectHeading(hLevel: number, expectedText: string): void {
|
|||
let hTag = `h${hLevel}`;
|
||||
let hText = element(by.css(hTag)).getText();
|
||||
expect(hText).toEqual(expectedText, hTag);
|
||||
};
|
||||
}
|
||||
|
||||
function getHeroAEltById(id: number): ElementFinder {
|
||||
let spanForId = element(by.cssContainingText('li span.badge', id.toString()));
|
||||
|
|
|
@ -81,7 +81,7 @@ describe('PhoneCat Application', function() {
|
|||
waitForCount(phoneList, 1);
|
||||
|
||||
let nexusPhone = phoneList.first();
|
||||
let detailLink = nexusPhone.all(by.css('a')).first()
|
||||
let detailLink = nexusPhone.all(by.css('a')).first();
|
||||
|
||||
detailLink.click();
|
||||
expect(browser.getLocationAbsUrl()).toBe('/phones/nexus-s');
|
||||
|
|
Loading…
Reference in New Issue