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
fc709423f2
commit
8aa29438ac
@ -31,7 +31,7 @@ export class MyCounterComponent implements OnChanges {
|
||||
}
|
||||
|
||||
// A change to `counter` is the only change we care about
|
||||
let chng = changes['counter'];
|
||||
let chng = changes.counter;
|
||||
let cur = chng.currentValue;
|
||||
let prev = JSON.stringify(chng.previousValue); // first time is {}; after is integer
|
||||
this.changeLog.push(`counter: currentValue = ${cur}, previousValue = ${prev}`);
|
||||
|
@ -57,7 +57,7 @@ export class PeekABooComponent extends PeekABooDirective implements
|
||||
let changesMsgs: string[] = [];
|
||||
for (let propName in changes) {
|
||||
if (propName === 'name') {
|
||||
let name = changes['name'].currentValue;
|
||||
let name = changes.name.currentValue;
|
||||
changesMsgs.push(`name ${this.verb} to "${name}"`);
|
||||
} else {
|
||||
changesMsgs.push(propName + ' ' + this.verb);
|
||||
|
Reference in New Issue
Block a user