refactor(): use const and let instead of var

This commit is contained in:
Joao Dias
2016-11-12 14:08:58 +01:00
committed by Victor Berchet
parent 73593d4bf3
commit 77ee27c59e
435 changed files with 4637 additions and 4663 deletions

View File

@ -10,7 +10,7 @@ import {$, ExpectedConditions, browser, by, element} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../../_common/e2e_util';
function waitForElement(selector: string) {
var EC = ExpectedConditions;
const EC = ExpectedConditions;
// Waits for the element with id 'abc' to be present on the dom.
browser.wait(EC.presenceOf($(selector)), 20000);
}
@ -19,7 +19,7 @@ describe('animation example', () => {
afterEach(verifyNoBrowserErrors);
describe('index view', () => {
var URL = '/core/animation/ts/dsl/';
const URL = '/core/animation/ts/dsl/';
it('should list out the current collection of items', () => {
browser.get(URL);

View File

@ -8,8 +8,8 @@
import {DebugElement} from '@angular/core';
var debugElement: DebugElement;
var predicate: any;
let debugElement: DebugElement;
let predicate: any;
// #docregion scope_all
debugElement.query(predicate);

View File

@ -12,7 +12,7 @@ export function main() {
describe('forwardRef examples', () => {
it('ForwardRefFn example works', () => {
// #docregion forward_ref_fn
let ref = forwardRef(() => Lock);
const ref = forwardRef(() => Lock);
// #enddocregion
expect(ref).not.toBeNull();
@ -32,8 +32,8 @@ export function main() {
// Only at this point Lock is defined.
class Lock {}
let injector = ReflectiveInjector.resolveAndCreate([Door, Lock]);
let door = injector.get(Door);
const injector = ReflectiveInjector.resolveAndCreate([Door, Lock]);
const door = injector.get(Door);
expect(door instanceof Door).toBeTruthy();
expect(door.lock instanceof Lock).toBeTruthy();
// #enddocregion
@ -41,7 +41,7 @@ export function main() {
it('can be unwrapped', () => {
// #docregion resolve_forward_ref
let ref = forwardRef(() => 'refValue');
const ref = forwardRef(() => 'refValue');
expect(resolveForwardRef(ref)).toEqual('refValue');
expect(resolveForwardRef('regularValue')).toEqual('regularValue');
// #enddocregion

View File

@ -14,6 +14,6 @@ import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
class MyApp {
}
var myPlatformFactory = createPlatformFactory(platformBrowserDynamic, 'myPlatform');
const myPlatformFactory = createPlatformFactory(platformBrowserDynamic, 'myPlatform');
myPlatformFactory().bootstrapModule(MyApp);
// #enddocregion