style(docs-infra): fix docs examples for tslint rules related to whitespace (#38143)
This commit updates the docs examples to be compatible with the `align`, `space-before-function-paren` and `typedef-whitespace` tslint rules. 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
0a791e4a50
commit
7c0f11789b
@ -11,8 +11,8 @@ describe('Binding syntax e2e tests', () => {
|
||||
// helper function used to test what's logged to the console
|
||||
async function logChecker(button, contents) {
|
||||
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
||||
const message = logs.filter(({ message }) => message.indexOf(contents) !== -1 ? true : false);
|
||||
expect(message.length).toBeGreaterThan(0);
|
||||
const messages = logs.filter(({ message }) => message.indexOf(contents) !== -1 ? true : false);
|
||||
expect(messages.length).toBeGreaterThan(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* tslint:disable:no-unused-variable component-selector-name one-line check-open-brace */
|
||||
/* tslint:disable: no-unused-variable component-selector-name one-line space-before-function-paren */
|
||||
/* tslint:disable:*/
|
||||
// #docplaster
|
||||
// #docregion
|
||||
|
@ -20,6 +20,7 @@ export function simpleCar() {
|
||||
constructor(public cylinders: number) { }
|
||||
}
|
||||
// #enddocregion car-ctor-instantiation-with-param
|
||||
|
||||
export function superCar() {
|
||||
// #docregion car-ctor-instantiation-with-param
|
||||
// Super car with 12 cylinders and Flintstone tires.
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { browser, element, by } from 'protractor';
|
||||
|
||||
describe('Getting Started V0', () => {
|
||||
beforeEach(() => {
|
||||
return browser.get('/');
|
||||
});
|
||||
beforeEach(() => browser.get('/'));
|
||||
|
||||
it('should display "My Store" in the top bar', async () => {
|
||||
const title = await element(by.css('app-root app-top-bar h1')).getText();
|
||||
|
@ -15,8 +15,10 @@ export class HttpErrorHandler {
|
||||
constructor(private messageService: MessageService) { }
|
||||
|
||||
/** Create curried handleError function that already knows the service name */
|
||||
createHandleError = (serviceName = '') => <T>
|
||||
(operation = 'operation', result = {} as T) => this.handleError(serviceName, operation, result);
|
||||
createHandleError = (serviceName = '') => {
|
||||
return <T>(operation = 'operation', result = {} as T) =>
|
||||
this.handleError(serviceName, operation, result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a function that handles Http operation failures.
|
||||
|
@ -12,8 +12,9 @@ import { Observable } from 'rxjs';
|
||||
<div [hidden]="!visible">
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
</div>`})
|
||||
|
||||
</div>
|
||||
`,
|
||||
})
|
||||
export class ZippyComponent {
|
||||
visible = true;
|
||||
@Output() open = new EventEmitter<any>();
|
||||
|
@ -4,18 +4,21 @@ import { Routes, RouterModule } from '@angular/router'; // CLI imports router
|
||||
|
||||
// #docregion child-routes
|
||||
const routes: Routes = [
|
||||
{ path: 'first-component',
|
||||
{
|
||||
path: 'first-component',
|
||||
component: FirstComponent, // this is the component with the <router-outlet> in the template
|
||||
children: [
|
||||
{
|
||||
path: 'child-a', // child route path
|
||||
component: ChildAComponent // child route component that the router renders
|
||||
component: ChildAComponent, // child route component that the router renders
|
||||
},
|
||||
{
|
||||
path: 'child-b',
|
||||
component: ChildBComponent // another child route component that the router renders
|
||||
}
|
||||
] },
|
||||
component: ChildBComponent, // another child route component that the router renders
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
// #enddocregion child-routes
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user