Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 0281c06

Browse files
mvuksanomhevery
authored andcommitted
style: Rename variables of the form $name into name .
Closes #854
1 parent 277f283 commit 0281c06

File tree

12 files changed

+153
-152
lines changed

12 files changed

+153
-152
lines changed

lib/core/interpolate.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ part of angular.core_internal;
44
* Compiles a string with markup into an expression. This service is used by the
55
* HTML [Compiler] service for data binding.
66
*
7-
* var $interpolate = ...; // injected
8-
* var exp = $interpolate('Hello {{name}}!');
7+
* var interpolate = ...; // injected
8+
* var exp = interpolate('Hello {{name}}!');
99
* expect(exp).toEqual('"Hello "+(name)+"!"');
1010
*/
1111
@NgInjectableService()

lib/core_dom/view_factory.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ class WalkingViewFactory implements ViewFactory {
119119
class ViewCache {
120120
// _viewFactoryCache is unbounded
121121
final _viewFactoryCache = new LruCache<String, ViewFactory>(capacity: 0);
122-
final Http $http;
123-
final TemplateCache $templateCache;
122+
final Http http;
123+
final TemplateCache templateCache;
124124
final Compiler compiler;
125125
final dom.NodeTreeSanitizer treeSanitizer;
126126

127-
ViewCache(this.$http, this.$templateCache, this.compiler, this.treeSanitizer);
127+
ViewCache(this.http, this.templateCache, this.compiler, this.treeSanitizer);
128128

129129
ViewFactory fromHtml(String html, DirectiveMap directives) {
130130
ViewFactory viewFactory = _viewFactoryCache.get(html);
@@ -138,7 +138,7 @@ class ViewCache {
138138
}
139139

140140
async.Future<ViewFactory> fromUrl(String url, DirectiveMap directives) {
141-
return $http.getString(url, cache: $templateCache).then(
141+
return http.getString(url, cache: templateCache).then(
142142
(html) => fromHtml(html, directives));
143143
}
144144
}
@@ -165,7 +165,7 @@ class _ComponentFactory implements Function {
165165
this._expando);
166166

167167
dynamic call(Injector injector, Scope scope,
168-
ViewCache $viewCache, Http $http, TemplateCache $templateCache,
168+
ViewCache viewCache, Http http, TemplateCache templateCache,
169169
DirectiveMap directives) {
170170
shadowDom = element.createShadowRoot()
171171
..applyAuthorStyles = component.applyAuthorStyles
@@ -180,19 +180,19 @@ class _ComponentFactory implements Function {
180180
List<async.Future<String>> cssFutures = new List();
181181
var cssUrls = component.cssUrls;
182182
if (cssUrls.isNotEmpty) {
183-
cssUrls.forEach((css) => cssFutures.add($http
184-
.getString(css, cache: $templateCache)
183+
cssUrls.forEach((css) => cssFutures.add(http
184+
.getString(css, cache: templateCache)
185185
.catchError((e) => '/*\n$e\n*/\n')
186186
));
187187
} else {
188188
cssFutures.add(new async.Future.value(null));
189189
}
190190
var viewFuture;
191191
if (component.template != null) {
192-
viewFuture = new async.Future.value($viewCache.fromHtml(
192+
viewFuture = new async.Future.value(viewCache.fromHtml(
193193
component.template, directives));
194194
} else if (component.templateUrl != null) {
195-
viewFuture = $viewCache.fromUrl(component.templateUrl, directives);
195+
viewFuture = viewCache.fromUrl(component.templateUrl, directives);
196196
}
197197
TemplateLoader templateLoader = new TemplateLoader(
198198
async.Future.wait(cssFutures).then((Iterable<String> cssList) {

lib/directive/ng_a.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ part of angular.directive;
1111
*
1212
* This change permits the easy creation of action links with the `ngClick`
1313
* directive without changing the location or causing page reloads, e.g.:
14-
* `<a href="" ng-click="model.$save()">Save</a>`
14+
* `<a href="" ng-click="model.save()">Save</a>`
1515
*/
1616
@NgDirective(selector: 'a[href]')
1717
class NgA {

lib/mock/http_backend.dart

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,48 @@ import 'package:angular/utils.dart' as utils;
99

1010

1111
class _MockXhr {
12-
var $$method, $$url, $$async, $$reqHeaders, $$respHeaders;
12+
var method, url, async, reqHeaders, respHeaders;
1313

1414
void open(method, url, async) {
15-
$$method = method;
16-
$$url = url;
17-
$$async = async;
18-
$$reqHeaders = {};
19-
$$respHeaders = {};
15+
this.method = method;
16+
this.url = url;
17+
this.async = async;
18+
reqHeaders = {};
19+
respHeaders = {};
2020
}
2121

22-
var $$data;
22+
var data;
2323

2424
void send(data) {
25-
$$data = data;
25+
data = data;
2626
}
2727

2828
void setRequestHeader(key, value) {
29-
$$reqHeaders[key] = value;
29+
reqHeaders[key] = value;
3030
}
3131

3232
String getResponseHeader(name) {
3333
// the lookup must be case insensitive, that's why we try two quick
3434
// lookups and full scan at last
35-
if ($$respHeaders.containsKey(name)) return $$respHeaders[name];
35+
if (respHeaders.containsKey(name)) return respHeaders[name];
3636

3737
name = name.toLowerCase();
38-
if ($$respHeaders.containsKey(name)) return $$respHeaders[name];
38+
if (respHeaders.containsKey(name)) return respHeaders[name];
3939

4040
String header = null;
41-
$$respHeaders.forEach((headerName, headerVal) {
41+
respHeaders.forEach((headerName, headerVal) {
4242
if (header != null) return;
4343
if (headerName.toLowerCase()) header = headerVal;
4444
});
4545
return header;
4646
}
4747

4848
getAllResponseHeaders() {
49-
if ($$respHeaders == null) return '';
49+
if (respHeaders == null) return '';
5050

5151
var lines = [];
5252

53-
$$respHeaders.forEach((key, value) {
53+
respHeaders.forEach((key, value) {
5454
lines.add("$key: $value");
5555
});
5656
return lines.join('\n');
@@ -177,7 +177,7 @@ class MockHttpBackend implements HttpBackend {
177177
var wrapResponse = (wrapped) {
178178
var handleResponse = () {
179179
var response = wrapped.response(method, url, data, headers);
180-
xhr.$$respHeaders = response[2];
180+
xhr.respHeaders = response[2];
181181
utils.relaxFnApply(callback, [response[0], response[1],
182182
xhr.getAllResponseHeaders()]);
183183
};
@@ -260,8 +260,8 @@ class MockHttpBackend implements HttpBackend {
260260

261261
/**
262262
* @ngdoc method
263-
* @name ngMock.$httpBackend#whenGET
264-
* @methodOf ngMock.$httpBackend
263+
* @name ngMock.httpBackend#whenGET
264+
* @methodOf ngMock.httpBackend
265265
* @description
266266
* Creates a new backend definition for GET requests. For more info see `when()`.
267267
*
@@ -274,8 +274,8 @@ class MockHttpBackend implements HttpBackend {
274274

275275
/**
276276
* @ngdoc method
277-
* @name ngMock.$httpBackend#whenDELETE
278-
* @methodOf ngMock.$httpBackend
277+
* @name ngMock.httpBackend#whenDELETE
278+
* @methodOf ngMock.httpBackend
279279
* @description
280280
* Creates a new backend definition for DELETE requests. For more info see `when()`.
281281
*
@@ -288,8 +288,8 @@ class MockHttpBackend implements HttpBackend {
288288

289289
/**
290290
* @ngdoc method
291-
* @name ngMock.$httpBackend#whenJSONP
292-
* @methodOf ngMock.$httpBackend
291+
* @name ngMock.httpBackend#whenJSONP
292+
* @methodOf ngMock.httpBackend
293293
* @description
294294
* Creates a new backend definition for JSONP requests. For more info see `when()`.
295295
*
@@ -301,8 +301,8 @@ class MockHttpBackend implements HttpBackend {
301301

302302
/**
303303
* @ngdoc method
304-
* @name ngMock.$httpBackend#whenPUT
305-
* @methodOf ngMock.$httpBackend
304+
* @name ngMock.httpBackend#whenPUT
305+
* @methodOf ngMock.httpBackend
306306
* @description
307307
* Creates a new backend definition for PUT requests. For more info see `when()`.
308308
*
@@ -316,8 +316,8 @@ class MockHttpBackend implements HttpBackend {
316316

317317
/**
318318
* @ngdoc method
319-
* @name ngMock.$httpBackend#whenPOST
320-
* @methodOf ngMock.$httpBackend
319+
* @name ngMock.httpBackend#whenPOST
320+
* @methodOf ngMock.httpBackend
321321
* @description
322322
* Creates a new backend definition for POST requests. For more info see `when()`.
323323
*
@@ -333,8 +333,8 @@ class MockHttpBackend implements HttpBackend {
333333

334334
/**
335335
* @ngdoc method
336-
* @name ngMock.$httpBackend#whenHEAD
337-
* @methodOf ngMock.$httpBackend
336+
* @name ngMock.httpBackend#whenHEAD
337+
* @methodOf ngMock.httpBackend
338338
* @description
339339
* Creates a new backend definition for HEAD requests. For more info see `when()`.
340340
*
@@ -346,8 +346,8 @@ class MockHttpBackend implements HttpBackend {
346346

347347
/**
348348
* @ngdoc method
349-
* @name ngMock.$httpBackend#expect
350-
* @methodOf ngMock.$httpBackend
349+
* @name ngMock.httpBackend#expect
350+
* @methodOf ngMock.httpBackend
351351
* @description
352352
* Creates a new request expectation.
353353
*
@@ -375,8 +375,8 @@ class MockHttpBackend implements HttpBackend {
375375

376376
/**
377377
* @ngdoc method
378-
* @name ngMock.$httpBackend#expectGET
379-
* @methodOf ngMock.$httpBackend
378+
* @name ngMock.httpBackend#expectGET
379+
* @methodOf ngMock.httpBackend
380380
* @description
381381
* Creates a new request expectation for GET requests. For more info see `expect()`.
382382
*
@@ -389,8 +389,8 @@ class MockHttpBackend implements HttpBackend {
389389

390390
/**
391391
* @ngdoc method
392-
* @name ngMock.$httpBackend#expectDELETE
393-
* @methodOf ngMock.$httpBackend
392+
* @name ngMock.httpBackend#expectDELETE
393+
* @methodOf ngMock.httpBackend
394394
* @description
395395
* Creates a new request expectation for DELETE requests. For more info see `expect()`.
396396
*
@@ -403,8 +403,8 @@ class MockHttpBackend implements HttpBackend {
403403

404404
/**
405405
* @ngdoc method
406-
* @name ngMock.$httpBackend#expectJSONP
407-
* @methodOf ngMock.$httpBackend
406+
* @name ngMock.httpBackend#expectJSONP
407+
* @methodOf ngMock.httpBackend
408408
* @description
409409
* Creates a new request expectation for JSONP requests. For more info see `expect()`.
410410
*
@@ -416,8 +416,8 @@ class MockHttpBackend implements HttpBackend {
416416

417417
/**
418418
* @ngdoc method
419-
* @name ngMock.$httpBackend#expectPUT
420-
* @methodOf ngMock.$httpBackend
419+
* @name ngMock.httpBackend#expectPUT
420+
* @methodOf ngMock.httpBackend
421421
* @description
422422
* Creates a new request expectation for PUT requests. For more info see `expect()`.
423423
*
@@ -431,8 +431,8 @@ class MockHttpBackend implements HttpBackend {
431431

432432
/**
433433
* @ngdoc method
434-
* @name ngMock.$httpBackend#expectPOST
435-
* @methodOf ngMock.$httpBackend
434+
* @name ngMock.httpBackend#expectPOST
435+
* @methodOf ngMock.httpBackend
436436
* @description
437437
* Creates a new request expectation for POST requests. For more info see `expect()`.
438438
*
@@ -446,8 +446,8 @@ class MockHttpBackend implements HttpBackend {
446446

447447
/**
448448
* @ngdoc method
449-
* @name ngMock.$httpBackend#expectPATCH
450-
* @methodOf ngMock.$httpBackend
449+
* @name ngMock.httpBackend#expectPATCH
450+
* @methodOf ngMock.httpBackend
451451
* @description
452452
* Creates a new request expectation for PATCH requests. For more info see `expect()`.
453453
*
@@ -461,8 +461,8 @@ class MockHttpBackend implements HttpBackend {
461461

462462
/**
463463
* @ngdoc method
464-
* @name ngMock.$httpBackend#expectHEAD
465-
* @methodOf ngMock.$httpBackend
464+
* @name ngMock.httpBackend#expectHEAD
465+
* @methodOf ngMock.httpBackend
466466
* @description
467467
* Creates a new request expectation for HEAD requests. For more info see `expect()`.
468468
*
@@ -474,8 +474,8 @@ class MockHttpBackend implements HttpBackend {
474474

475475
/**
476476
* @ngdoc method
477-
* @name ngMock.$httpBackend#flush
478-
* @methodOf ngMock.$httpBackend
477+
* @name ngMock.httpBackend#flush
478+
* @methodOf ngMock.httpBackend
479479
* @description
480480
* Flushes all pending requests using the trained responses.
481481
*
@@ -502,8 +502,8 @@ class MockHttpBackend implements HttpBackend {
502502

503503
/**
504504
* @ngdoc method
505-
* @name ngMock.$httpBackend#verifyNoOutstandingExpectation
506-
* @methodOf ngMock.$httpBackend
505+
* @name ngMock.httpBackend#verifyNoOutstandingExpectation
506+
* @methodOf ngMock.httpBackend
507507
* @description
508508
* Verifies that all of the requests defined via the `expect` api were made. If any of the
509509
* requests were not made, verifyNoOutstandingExpectation throws an exception.
@@ -512,7 +512,7 @@ class MockHttpBackend implements HttpBackend {
512512
* "afterEach" clause.
513513
*
514514
* <pre>
515-
* afterEach($httpBackend.verifyNoOutstandingExpectation);
515+
* afterEach(httpBackend.verifyNoOutstandingExpectation);
516516
* </pre>
517517
*/
518518
void verifyNoOutstandingExpectation() {
@@ -524,16 +524,16 @@ class MockHttpBackend implements HttpBackend {
524524

525525
/**
526526
* @ngdoc method
527-
* @name ngMock.$httpBackend#verifyNoOutstandingRequest
528-
* @methodOf ngMock.$httpBackend
527+
* @name ngMock.httpBackend#verifyNoOutstandingRequest
528+
* @methodOf ngMock.httpBackend
529529
* @description
530530
* Verifies that there are no outstanding requests that need to be flushed.
531531
*
532532
* Typically, you would call this method following each test case that asserts requests using an
533533
* "afterEach" clause.
534534
*
535535
* <pre>
536-
* afterEach($httpBackend.verifyNoOutstandingRequest);
536+
* afterEach(httpBackend.verifyNoOutstandingRequest);
537537
* </pre>
538538
*/
539539
void verifyNoOutstandingRequest() {
@@ -543,12 +543,12 @@ class MockHttpBackend implements HttpBackend {
543543

544544
/**
545545
* @ngdoc method
546-
* @name ngMock.$httpBackend#resetExpectations
547-
* @methodOf ngMock.$httpBackend
546+
* @name ngMock.httpBackend#resetExpectations
547+
* @methodOf ngMock.httpBackend
548548
* @description
549549
* Resets all request expectations, but preserves all backend definitions. Typically, you would
550550
* call resetExpectations during a multiple-phase test when you want to reuse the same instance of
551-
* $httpBackend mock.
551+
* httpBackend mock.
552552
*/
553553
void resetExpectations() {
554554
expectations.length = 0;

0 commit comments

Comments
 (0)