refactor: rename all const to UPPER_CASE

Closes #3573

BREAKING CHANGE

Rename:
- `appComponentTypeToken` => `APP_COMPONENT`
- `coreDirectives` => `CORE_DIRECTIVES`
- `formDirectives` => `FORM_DIRECTIVES`
- `formInjectables` => `FORM_BINDINGS`
- `httpInjectables` => `HTTP_BINDINGS`
- `jsonpInjectables` => `JSONP_BINDINGS`
- `PROTO_CHANGE_DETECTOR_KEY` => `PROTO_CHANGE_DETECTOR`
- `appComponentRefPromiseToken` => `APP_COMPONENT_REF_PROMISE`
- `appComponentTypeToken` => `APP_COMPONENT`
- `undefinedValue` => `UNDEFINED`
- `formDirectives` => `FORM_DIRECTIVES`
- `DOCUMENT_TOKEN` => `DOCUMENT`
- `APP_ID_TOKEN` => `APP_ID`
- `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN` => `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE`
- `appBaseHrefToken` => `APP_BASE_HREF`
This commit is contained in:
Misko Hevery
2015-08-10 21:42:47 -07:00
parent 1d65b38b28
commit 60af19f0e1
54 changed files with 203 additions and 205 deletions

View File

@ -50,8 +50,8 @@ export {URLSearchParams} from 'http/src/url_search_params';
* #Example
*
* ```
* import {httpInjectables, Http} from 'http/http';
* @Component({selector: 'http-app', viewBindings: [httpInjectables]})
* import {HTTP_BINDINGS, Http} from 'http/http';
* @Component({selector: 'http-app', viewBindings: [HTTP_BINDINGS]})
* @View({template: '{{data}}'})
* class MyApp {
* constructor(http:Http) {
@ -61,7 +61,7 @@ export {URLSearchParams} from 'http/src/url_search_params';
* ```
*
*/
export var httpInjectables: List<any> = [
export const HTTP_BINDINGS: List<any> = [
bind(ConnectionBackend)
.toClass(XHRBackend),
BrowserXhr,
@ -70,7 +70,7 @@ export var httpInjectables: List<any> = [
Http
];
export var jsonpInjectables: List<any> = [
export const JSONP_BINDINGS: List<any> = [
bind(ConnectionBackend)
.toClass(JSONPBackend),
BrowserJsonp,

View File

@ -1,6 +1,6 @@
require('reflect-metadata');
require('traceur-runtime');
import {httpInjectables, jsonpInjectables, Http, Jsonp} from './http';
import {HTTP_BINDINGS, JSONP_BINDINGS, Http, Jsonp} from './http';
import {Injector} from 'angular2/angular2';
export * from './http';
@ -8,5 +8,5 @@ export * from './http';
* TODO(jeffbcross): export each as their own top-level file, to require as:
* require('http/http'); require('http/jsonp');
*/
export var http = Injector.resolveAndCreate([httpInjectables]).get(Http);
export var jsonp = Injector.resolveAndCreate([jsonpInjectables]).get(Jsonp);
export var http = Injector.resolveAndCreate([HTTP_BINDINGS]).get(Http);
export var jsonp = Injector.resolveAndCreate([JSONP_BINDINGS]).get(Jsonp);

View File

@ -84,11 +84,10 @@ export class XHRConnection implements Connection {
* #Example
*
* ```
* import {Http, MyNodeBackend, httpInjectables, BaseRequestOptions} from
*'angular2/http';
* import {Http, MyNodeBackend, HTTP_BINDINGS, BaseRequestOptions} from 'http/http';
* @Component({
* viewBindings: [
* httpInjectables,
* HTTP_BINDINGS,
* bind(Http).toFactory((backend, options) => {
* return new Http(backend, options);
* }, [MyNodeBackend, BaseRequestOptions])]

View File

@ -52,8 +52,8 @@ function mergeOptions(defaultOpts, providedOpts, method, url): RequestOptions {
* #Example
*
* ```
* import {Http, httpInjectables} from 'angular2/http';
* @Component({selector: 'http-app', viewBindings: [httpInjectables]})
* import {Http, HTTP_BINDINGS} from 'angular2/http';
* @Component({selector: 'http-app', viewBindings: [HTTP_BINDINGS]})
* @View({templateUrl: 'people.html'})
* class PeopleComponent {
* constructor(http: Http) {