refactor(docs-infra): fix docs examples for tslint rules related to object properties (#38143)
This commit updates the docs examples to be compatible with the `no-string-literal`, `object-literal-key-quotes` and `object-literal-shorthand` 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:

committed by
Alex Rickabaugh

parent
d4a723a464
commit
ff72da60d3
@ -40,8 +40,8 @@ export class ConfigComponent {
|
||||
this.configService.getConfig_1()
|
||||
// #docregion v1, v1_callback
|
||||
.subscribe((data: Config) => this.config = {
|
||||
heroesUrl: data['heroesUrl'],
|
||||
textfile: data['textfile']
|
||||
heroesUrl: data.heroesUrl,
|
||||
textfile: data.textfile
|
||||
});
|
||||
// #enddocregion v1_callback
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import { HttpErrorHandler, HandleError } from '../http-error-handler.service';
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'my-auth-token'
|
||||
Authorization: 'my-auth-token'
|
||||
})
|
||||
};
|
||||
// #enddocregion http-options
|
||||
|
@ -22,13 +22,13 @@ import './testing/http-client.spec.ts';
|
||||
bootstrap();
|
||||
|
||||
//
|
||||
function bootstrap () {
|
||||
if (window['jasmineRef']) {
|
||||
function bootstrap() {
|
||||
if ((window as any).jasmineRef) {
|
||||
location.reload();
|
||||
return;
|
||||
} else {
|
||||
window.onload(undefined);
|
||||
window['jasmineRef'] = jasmine.getEnv();
|
||||
(window as any).jasmineRef = jasmine.getEnv();
|
||||
}
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
|
@ -1,3 +1,3 @@
|
||||
import jasmineRequire from 'jasmine-core/lib/jasmine-core/jasmine.js';
|
||||
|
||||
window['jasmineRequire'] = jasmineRequire;
|
||||
(window as any).jasmineRequire = jasmineRequire;
|
||||
|
@ -73,7 +73,7 @@ describe('HttpClient testing', () => {
|
||||
|
||||
// Make an HTTP GET request with specific header
|
||||
httpClient.get<Data>(testUrl, {
|
||||
headers: new HttpHeaders({'Authorization': 'my-auth-token'})
|
||||
headers: new HttpHeaders({Authorization: 'my-auth-token'})
|
||||
})
|
||||
.subscribe(data =>
|
||||
expect(data).toEqual(testData)
|
||||
|
Reference in New Issue
Block a user