From 695923dcd65fcdd3a4fc068c708475ac795b0eb1 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Thu, 5 Nov 2015 14:58:24 -0800 Subject: [PATCH] refactor(core): move directives, pipes, and forms into common BREAKING CHANGE All private exports from 'angular2/src/core/{directives,pipes,forms}' should be replaced with 'angular2/src/common/{directives,pipes,formis}' Closes #5153 --- gulpfile.js | 2 +- modules/angular2/common.ts | 55 ++----------------- modules/angular2/core.dart | 6 +- modules/angular2/core.ts | 6 +- .../angular2/src/common/common_directives.ts | 49 +++++++++++++++++ modules/angular2/src/common/directives.ts | 12 ++++ .../directives/core_directives.ts} | 25 ++------- .../{core => common}/directives/ng_class.ts | 0 .../src/{core => common}/directives/ng_for.ts | 0 .../src/{core => common}/directives/ng_if.ts | 0 .../{core => common}/directives/ng_style.ts | 0 .../{core => common}/directives/ng_switch.ts | 0 .../directives/observable_list_diff.dart | 0 .../directives/observable_list_diff.ts | 0 .../angular2/src/{core => common}/forms.ts | 22 +------- .../src/{core => common}/forms/directives.ts | 0 .../directives/abstract_control_directive.ts | 0 .../directives/checkbox_value_accessor.ts | 0 .../forms/directives/control_container.ts | 0 .../directives/control_value_accessor.ts | 0 .../directives/default_value_accessor.ts | 0 .../forms/directives/form_interface.ts | 0 .../forms/directives/ng_control.ts | 0 .../forms/directives/ng_control_group.ts | 0 .../forms/directives/ng_control_name.ts | 0 .../forms/directives/ng_control_status.ts | 0 .../forms/directives/ng_form.ts | 0 .../forms/directives/ng_form_control.ts | 0 .../forms/directives/ng_form_model.ts | 0 .../forms/directives/ng_model.ts | 0 .../forms/directives/normalize_validator.dart | 2 +- .../forms/directives/normalize_validator.ts | 0 .../forms/directives/number_value_accessor.ts | 0 .../select_control_value_accessor.ts | 0 .../forms/directives/shared.ts | 0 .../forms/directives/validators.ts | 0 .../{core => common}/forms/form_builder.ts | 18 +++++- .../src/{core => common}/forms/model.ts | 0 .../src/{core => common}/forms/validators.ts | 2 +- .../angular2/src/{core => common}/pipes.ts | 0 .../src/{core => common}/pipes/async_pipe.ts | 0 .../angular2/src/common/pipes/common_pipes.ts | 25 +++++++++ .../src/{core => common}/pipes/date_pipe.ts | 0 .../pipes/invalid_pipe_argument_exception.ts | 0 .../src/{core => common}/pipes/json_pipe.ts | 0 .../{core => common}/pipes/lowercase_pipe.ts | 0 .../src/{core => common}/pipes/number_pipe.ts | 0 .../src/{core => common}/pipes/slice_pipe.ts | 2 +- .../{core => common}/pipes/uppercase_pipe.ts | 0 .../angular2/src/core/application_common.ts | 2 +- .../web_workers/worker/application_common.ts | 2 +- .../directives/ng_class_spec.ts | 2 +- .../directives/ng_for_spec.ts | 2 +- .../{core => common}/directives/ng_if_spec.ts | 0 .../directives/ng_style_spec.ts | 2 +- .../directives/ng_switch_spec.ts | 2 +- .../directives/non_bindable_spec.ts | 0 .../directives/observable_list_diff_spec.dart | 0 .../{core => common}/forms/directives_spec.ts | 3 +- .../forms/form_builder_spec.ts | 0 .../forms/integration_spec.ts | 0 .../test/{core => common}/forms/model_spec.ts | 0 .../{core => common}/forms/validators_spec.ts | 0 .../{core => common}/pipes/async_pipe_spec.ts | 3 +- .../{core => common}/pipes/date_pipe_spec.ts | 0 .../{core => common}/pipes/json_pipe_spec.ts | 1 - .../pipes/lowercase_pipe_spec.ts | 0 .../pipes/number_pipe_spec.ts | 0 .../pipes/pipe_binding_spec.ts | 0 .../test/{core => common}/pipes/pipes_spec.ts | 0 .../{core => common}/pipes/slice_pipe_spec.ts | 0 .../pipes/uppercase_pipe_spec.ts | 0 modules/angular2/test/common/spies.dart | 20 +++++++ .../test/{core/pipes => common}/spies.ts | 7 ++- modules/angular2/test/core/pipes/spies.dart | 9 --- modules/angular2/test/core/spies.dart | 12 +--- modules/angular2/test/core/spies.ts | 6 +- modules/angular2/web_worker/worker.ts | 6 +- modules/playground/pubspec.yaml | 2 +- .../lib/src/transform/common/options.dart | 2 +- .../ng_for.ng_meta.dart | 2 +- tools/broccoli/trees/node_tree.ts | 2 +- 82 files changed, 166 insertions(+), 147 deletions(-) create mode 100644 modules/angular2/src/common/common_directives.ts create mode 100644 modules/angular2/src/common/directives.ts rename modules/angular2/src/{core/directives.ts => common/directives/core_directives.ts} (64%) rename modules/angular2/src/{core => common}/directives/ng_class.ts (100%) rename modules/angular2/src/{core => common}/directives/ng_for.ts (100%) rename modules/angular2/src/{core => common}/directives/ng_if.ts (100%) rename modules/angular2/src/{core => common}/directives/ng_style.ts (100%) rename modules/angular2/src/{core => common}/directives/ng_switch.ts (100%) rename modules/angular2/src/{core => common}/directives/observable_list_diff.dart (100%) rename modules/angular2/src/{core => common}/directives/observable_list_diff.ts (100%) rename modules/angular2/src/{core => common}/forms.ts (80%) rename modules/angular2/src/{core => common}/forms/directives.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/abstract_control_directive.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/checkbox_value_accessor.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/control_container.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/control_value_accessor.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/default_value_accessor.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/form_interface.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/ng_control.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/ng_control_group.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/ng_control_name.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/ng_control_status.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/ng_form.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/ng_form_control.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/ng_form_model.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/ng_model.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/normalize_validator.dart (71%) rename modules/angular2/src/{core => common}/forms/directives/normalize_validator.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/number_value_accessor.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/select_control_value_accessor.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/shared.ts (100%) rename modules/angular2/src/{core => common}/forms/directives/validators.ts (100%) rename modules/angular2/src/{core => common}/forms/form_builder.ts (91%) rename modules/angular2/src/{core => common}/forms/model.ts (100%) rename modules/angular2/src/{core => common}/forms/validators.ts (98%) rename modules/angular2/src/{core => common}/pipes.ts (100%) rename modules/angular2/src/{core => common}/pipes/async_pipe.ts (100%) create mode 100644 modules/angular2/src/common/pipes/common_pipes.ts rename modules/angular2/src/{core => common}/pipes/date_pipe.ts (100%) rename modules/angular2/src/{core => common}/pipes/invalid_pipe_argument_exception.ts (100%) rename modules/angular2/src/{core => common}/pipes/json_pipe.ts (100%) rename modules/angular2/src/{core => common}/pipes/lowercase_pipe.ts (100%) rename modules/angular2/src/{core => common}/pipes/number_pipe.ts (100%) rename modules/angular2/src/{core => common}/pipes/slice_pipe.ts (98%) rename modules/angular2/src/{core => common}/pipes/uppercase_pipe.ts (100%) rename modules/angular2/test/{core => common}/directives/ng_class_spec.ts (99%) rename modules/angular2/test/{core => common}/directives/ng_for_spec.ts (99%) rename modules/angular2/test/{core => common}/directives/ng_if_spec.ts (100%) rename modules/angular2/test/{core => common}/directives/ng_style_spec.ts (98%) rename modules/angular2/test/{core => common}/directives/ng_switch_spec.ts (99%) rename modules/angular2/test/{core => common}/directives/non_bindable_spec.ts (100%) rename modules/angular2/test/{core => common}/directives/observable_list_diff_spec.dart (100%) rename modules/angular2/test/{core => common}/forms/directives_spec.ts (99%) rename modules/angular2/test/{core => common}/forms/form_builder_spec.ts (100%) rename modules/angular2/test/{core => common}/forms/integration_spec.ts (100%) rename modules/angular2/test/{core => common}/forms/model_spec.ts (100%) rename modules/angular2/test/{core => common}/forms/validators_spec.ts (100%) rename modules/angular2/test/{core => common}/pipes/async_pipe_spec.ts (99%) rename modules/angular2/test/{core => common}/pipes/date_pipe_spec.ts (100%) rename modules/angular2/test/{core => common}/pipes/json_pipe_spec.ts (99%) rename modules/angular2/test/{core => common}/pipes/lowercase_pipe_spec.ts (100%) rename modules/angular2/test/{core => common}/pipes/number_pipe_spec.ts (100%) rename modules/angular2/test/{core => common}/pipes/pipe_binding_spec.ts (100%) rename modules/angular2/test/{core => common}/pipes/pipes_spec.ts (100%) rename modules/angular2/test/{core => common}/pipes/slice_pipe_spec.ts (100%) rename modules/angular2/test/{core => common}/pipes/uppercase_pipe_spec.ts (100%) create mode 100644 modules/angular2/test/common/spies.dart rename modules/angular2/test/{core/pipes => common}/spies.ts (71%) delete mode 100644 modules/angular2/test/core/pipes/spies.dart diff --git a/gulpfile.js b/gulpfile.js index 8096c39d83..2bd8637160 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -966,7 +966,7 @@ var bundleConfig = { // TODO: upgrade system builder and find a way to declare all input as cjs. meta: { 'angular2/src/router/route_definition': {format: 'cjs'}, - 'angular2/src/core/directives/observable_list_diff': {format: 'cjs'}, + 'angular2/src/common/directives/observable_list_diff': {format: 'cjs'}, 'angular2/lifecycle_hooks': {format: 'cjs'} } }; diff --git a/modules/angular2/common.ts b/modules/angular2/common.ts index f23536805b..4611aaaace 100644 --- a/modules/angular2/common.ts +++ b/modules/angular2/common.ts @@ -1,51 +1,4 @@ -import {CONST_EXPR, Type} from './src/core/facade/lang'; - -import {FORM_DIRECTIVES} from './src/core/forms'; -import {CORE_DIRECTIVES} from './src/core/directives'; -export * from './src/core/pipes'; -export * from './src/core/directives'; - -/** - * A collection of Angular core directives that are likely to be used in each and every Angular - * application. This includes core directives (e.g., NgIf and NgFor), and forms directives (e.g., - * NgModel). - * - * This collection can be used to quickly enumerate all the built-in directives in the `directives` - * property of the `@Component` or `@View` decorators. - * - * ### Example - * - * Instead of writing: - * - * ```typescript - * import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from - * 'angular2/angular2'; - * import {OtherDirective} from './myDirectives'; - * - * @Component({ - * selector: 'my-component', - * templateUrl: 'myComponent.html', - * directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm, - * OtherDirective] - * }) - * export class MyComponent { - * ... - * } - * ``` - * one could import all the common directives at once: - * - * ```typescript - * import {COMMON_DIRECTIVES} from 'angular2/angular2'; - * import {OtherDirective} from './myDirectives'; - * - * @Component({ - * selector: 'my-component', - * templateUrl: 'myComponent.html', - * directives: [COMMON_DIRECTIVES, OtherDirective] - * }) - * export class MyComponent { - * ... - * } - * ``` - */ -export const COMMON_DIRECTIVES: Type[][] = CONST_EXPR([CORE_DIRECTIVES, FORM_DIRECTIVES]); \ No newline at end of file +export * from './src/common/pipes'; +export * from './src/common/directives'; +export * from './src/common/forms'; +export * from './src/common/common_directives'; \ No newline at end of file diff --git a/modules/angular2/core.dart b/modules/angular2/core.dart index 26f8515519..db4f420fed 100644 --- a/modules/angular2/core.dart +++ b/modules/angular2/core.dart @@ -4,7 +4,7 @@ library angular2.core; export 'package:angular2/src/core/metadata.dart'; export 'package:angular2/src/core/util.dart'; export 'package:angular2/src/core/di.dart'; -export 'package:angular2/src/core/pipes.dart'; +export 'package:angular2/src/common/pipes.dart'; export 'package:angular2/src/core/facade.dart'; // Do not export application for dart. Must import from angular2/bootstrap //export 'package:angular2/src/core/application.dart'; @@ -14,7 +14,7 @@ export 'package:angular2/src/core/services.dart'; export 'package:angular2/src/core/linker.dart'; export 'package:angular2/src/core/zone.dart'; export 'package:angular2/src/core/render.dart'; -export 'package:angular2/src/core/directives.dart'; -export 'package:angular2/src/core/forms.dart'; +export 'package:angular2/src/common/directives.dart'; +export 'package:angular2/src/common/forms.dart'; export 'package:angular2/src/core/debug.dart'; export 'package:angular2/src/core/change_detection.dart'; diff --git a/modules/angular2/core.ts b/modules/angular2/core.ts index a97c5db627..b5eb20c3f0 100644 --- a/modules/angular2/core.ts +++ b/modules/angular2/core.ts @@ -6,7 +6,7 @@ export * from './src/core/metadata'; export * from './src/core/util'; export * from './src/core/di'; -export * from './src/core/pipes'; +export * from './src/common/pipes'; export * from './src/core/facade'; export * from './src/core/application'; export * from './src/core/bootstrap'; @@ -15,8 +15,8 @@ export * from './src/core/linker'; export {ApplicationRef} from './src/core/application_ref'; export * from './src/core/zone'; export * from './src/core/render'; -export * from './src/core/directives'; -export * from './src/core/forms'; +export * from './src/common/directives'; +export * from './src/common/forms'; export * from './src/core/debug'; export * from './src/core/change_detection'; export * from './src/core/ambient'; diff --git a/modules/angular2/src/common/common_directives.ts b/modules/angular2/src/common/common_directives.ts new file mode 100644 index 0000000000..29a00569c9 --- /dev/null +++ b/modules/angular2/src/common/common_directives.ts @@ -0,0 +1,49 @@ +import {CONST_EXPR, Type} from 'angular2/src/core/facade/lang'; + +import {FORM_DIRECTIVES} from './forms'; +import {CORE_DIRECTIVES} from './directives'; + +/** + * A collection of Angular core directives that are likely to be used in each and every Angular + * application. This includes core directives (e.g., NgIf and NgFor), and forms directives (e.g., + * NgModel). + * + * This collection can be used to quickly enumerate all the built-in directives in the `directives` + * property of the `@Component` or `@View` decorators. + * + * ### Example + * + * Instead of writing: + * + * ```typescript + * import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from + * 'angular2/angular2'; + * import {OtherDirective} from './myDirectives'; + * + * @Component({ + * selector: 'my-component', + * templateUrl: 'myComponent.html', + * directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm, + * OtherDirective] + * }) + * export class MyComponent { + * ... + * } + * ``` + * one could import all the common directives at once: + * + * ```typescript + * import {COMMON_DIRECTIVES} from 'angular2/angular2'; + * import {OtherDirective} from './myDirectives'; + * + * @Component({ + * selector: 'my-component', + * templateUrl: 'myComponent.html', + * directives: [COMMON_DIRECTIVES, OtherDirective] + * }) + * export class MyComponent { + * ... + * } + * ``` + */ +export const COMMON_DIRECTIVES: Type[][] = CONST_EXPR([CORE_DIRECTIVES, FORM_DIRECTIVES]); \ No newline at end of file diff --git a/modules/angular2/src/common/directives.ts b/modules/angular2/src/common/directives.ts new file mode 100644 index 0000000000..c777bae2dd --- /dev/null +++ b/modules/angular2/src/common/directives.ts @@ -0,0 +1,12 @@ +/** + * @module + * @description + * Common directives shipped with Angular. + */ +export {NgClass} from './directives/ng_class'; +export {NgFor} from './directives/ng_for'; +export {NgIf} from './directives/ng_if'; +export {NgStyle} from './directives/ng_style'; +export {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './directives/ng_switch'; +export * from './directives/observable_list_diff'; +export {CORE_DIRECTIVES} from './directives/core_directives'; \ No newline at end of file diff --git a/modules/angular2/src/core/directives.ts b/modules/angular2/src/common/directives/core_directives.ts similarity index 64% rename from modules/angular2/src/core/directives.ts rename to modules/angular2/src/common/directives/core_directives.ts index 8ff8399604..cde7f53c23 100644 --- a/modules/angular2/src/core/directives.ts +++ b/modules/angular2/src/common/directives/core_directives.ts @@ -1,22 +1,9 @@ -/** - * @module - * @description - * Common directives shipped with Angular. - */ - -import {CONST_EXPR, Type} from './facade/lang'; -import {NgClass} from './directives/ng_class'; -import {NgFor} from './directives/ng_for'; -import {NgIf} from './directives/ng_if'; -import {NgStyle} from './directives/ng_style'; -import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './directives/ng_switch'; - -export {NgClass} from './directives/ng_class'; -export {NgFor} from './directives/ng_for'; -export {NgIf} from './directives/ng_if'; -export {NgStyle} from './directives/ng_style'; -export {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './directives/ng_switch'; -export * from './directives/observable_list_diff'; +import {CONST_EXPR, Type} from 'angular2/src/core/facade/lang'; +import {NgClass} from './ng_class'; +import {NgFor} from './ng_for'; +import {NgIf} from './ng_if'; +import {NgStyle} from './ng_style'; +import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './ng_switch'; /** * A collection of Angular core directives that are likely to be used in each and every Angular diff --git a/modules/angular2/src/core/directives/ng_class.ts b/modules/angular2/src/common/directives/ng_class.ts similarity index 100% rename from modules/angular2/src/core/directives/ng_class.ts rename to modules/angular2/src/common/directives/ng_class.ts diff --git a/modules/angular2/src/core/directives/ng_for.ts b/modules/angular2/src/common/directives/ng_for.ts similarity index 100% rename from modules/angular2/src/core/directives/ng_for.ts rename to modules/angular2/src/common/directives/ng_for.ts diff --git a/modules/angular2/src/core/directives/ng_if.ts b/modules/angular2/src/common/directives/ng_if.ts similarity index 100% rename from modules/angular2/src/core/directives/ng_if.ts rename to modules/angular2/src/common/directives/ng_if.ts diff --git a/modules/angular2/src/core/directives/ng_style.ts b/modules/angular2/src/common/directives/ng_style.ts similarity index 100% rename from modules/angular2/src/core/directives/ng_style.ts rename to modules/angular2/src/common/directives/ng_style.ts diff --git a/modules/angular2/src/core/directives/ng_switch.ts b/modules/angular2/src/common/directives/ng_switch.ts similarity index 100% rename from modules/angular2/src/core/directives/ng_switch.ts rename to modules/angular2/src/common/directives/ng_switch.ts diff --git a/modules/angular2/src/core/directives/observable_list_diff.dart b/modules/angular2/src/common/directives/observable_list_diff.dart similarity index 100% rename from modules/angular2/src/core/directives/observable_list_diff.dart rename to modules/angular2/src/common/directives/observable_list_diff.dart diff --git a/modules/angular2/src/core/directives/observable_list_diff.ts b/modules/angular2/src/common/directives/observable_list_diff.ts similarity index 100% rename from modules/angular2/src/core/directives/observable_list_diff.ts rename to modules/angular2/src/common/directives/observable_list_diff.ts diff --git a/modules/angular2/src/core/forms.ts b/modules/angular2/src/common/forms.ts similarity index 80% rename from modules/angular2/src/core/forms.ts rename to modules/angular2/src/common/forms.ts index 594c410f2b..e18ef145e8 100644 --- a/modules/angular2/src/core/forms.ts +++ b/modules/angular2/src/common/forms.ts @@ -11,7 +11,6 @@ * explicitly. * */ - export {AbstractControl, Control, ControlGroup, ControlArray} from './forms/model'; export {AbstractControlDirective} from './forms/directives/abstract_control_directive'; @@ -40,23 +39,4 @@ export { MaxLengthValidator, Validator } from './forms/directives/validators'; -export {FormBuilder} from './forms/form_builder'; - -import {FormBuilder} from './forms/form_builder'; -import {CONST_EXPR, Type} from './facade/lang'; - -/** - * Shorthand set of providers used for building Angular forms. - * - * ### Example - * - * ```typescript - * bootstrap(MyApp, [FORM_PROVIDERS]); - * ``` - */ -export const FORM_PROVIDERS: Type[] = CONST_EXPR([FormBuilder]); - -/** - * @deprecated - */ -export const FORM_BINDINGS = FORM_PROVIDERS; +export {FormBuilder, FORM_PROVIDERS, FORM_BINDINGS} from './forms/form_builder'; \ No newline at end of file diff --git a/modules/angular2/src/core/forms/directives.ts b/modules/angular2/src/common/forms/directives.ts similarity index 100% rename from modules/angular2/src/core/forms/directives.ts rename to modules/angular2/src/common/forms/directives.ts diff --git a/modules/angular2/src/core/forms/directives/abstract_control_directive.ts b/modules/angular2/src/common/forms/directives/abstract_control_directive.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/abstract_control_directive.ts rename to modules/angular2/src/common/forms/directives/abstract_control_directive.ts diff --git a/modules/angular2/src/core/forms/directives/checkbox_value_accessor.ts b/modules/angular2/src/common/forms/directives/checkbox_value_accessor.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/checkbox_value_accessor.ts rename to modules/angular2/src/common/forms/directives/checkbox_value_accessor.ts diff --git a/modules/angular2/src/core/forms/directives/control_container.ts b/modules/angular2/src/common/forms/directives/control_container.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/control_container.ts rename to modules/angular2/src/common/forms/directives/control_container.ts diff --git a/modules/angular2/src/core/forms/directives/control_value_accessor.ts b/modules/angular2/src/common/forms/directives/control_value_accessor.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/control_value_accessor.ts rename to modules/angular2/src/common/forms/directives/control_value_accessor.ts diff --git a/modules/angular2/src/core/forms/directives/default_value_accessor.ts b/modules/angular2/src/common/forms/directives/default_value_accessor.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/default_value_accessor.ts rename to modules/angular2/src/common/forms/directives/default_value_accessor.ts diff --git a/modules/angular2/src/core/forms/directives/form_interface.ts b/modules/angular2/src/common/forms/directives/form_interface.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/form_interface.ts rename to modules/angular2/src/common/forms/directives/form_interface.ts diff --git a/modules/angular2/src/core/forms/directives/ng_control.ts b/modules/angular2/src/common/forms/directives/ng_control.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/ng_control.ts rename to modules/angular2/src/common/forms/directives/ng_control.ts diff --git a/modules/angular2/src/core/forms/directives/ng_control_group.ts b/modules/angular2/src/common/forms/directives/ng_control_group.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/ng_control_group.ts rename to modules/angular2/src/common/forms/directives/ng_control_group.ts diff --git a/modules/angular2/src/core/forms/directives/ng_control_name.ts b/modules/angular2/src/common/forms/directives/ng_control_name.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/ng_control_name.ts rename to modules/angular2/src/common/forms/directives/ng_control_name.ts diff --git a/modules/angular2/src/core/forms/directives/ng_control_status.ts b/modules/angular2/src/common/forms/directives/ng_control_status.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/ng_control_status.ts rename to modules/angular2/src/common/forms/directives/ng_control_status.ts diff --git a/modules/angular2/src/core/forms/directives/ng_form.ts b/modules/angular2/src/common/forms/directives/ng_form.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/ng_form.ts rename to modules/angular2/src/common/forms/directives/ng_form.ts diff --git a/modules/angular2/src/core/forms/directives/ng_form_control.ts b/modules/angular2/src/common/forms/directives/ng_form_control.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/ng_form_control.ts rename to modules/angular2/src/common/forms/directives/ng_form_control.ts diff --git a/modules/angular2/src/core/forms/directives/ng_form_model.ts b/modules/angular2/src/common/forms/directives/ng_form_model.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/ng_form_model.ts rename to modules/angular2/src/common/forms/directives/ng_form_model.ts diff --git a/modules/angular2/src/core/forms/directives/ng_model.ts b/modules/angular2/src/common/forms/directives/ng_model.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/ng_model.ts rename to modules/angular2/src/common/forms/directives/ng_model.ts diff --git a/modules/angular2/src/core/forms/directives/normalize_validator.dart b/modules/angular2/src/common/forms/directives/normalize_validator.dart similarity index 71% rename from modules/angular2/src/core/forms/directives/normalize_validator.dart rename to modules/angular2/src/common/forms/directives/normalize_validator.dart index 479096c6b1..83049a9600 100644 --- a/modules/angular2/src/core/forms/directives/normalize_validator.dart +++ b/modules/angular2/src/common/forms/directives/normalize_validator.dart @@ -1,6 +1,6 @@ library angular2.core.forms.normalize_validators; -import 'package:angular2/src/core/forms/directives/validators.dart' show Validator; +import 'package:angular2/src/common/forms/directives/validators.dart' show Validator; Function normalizeValidator(dynamic validator){ if (validator is Validator) { diff --git a/modules/angular2/src/core/forms/directives/normalize_validator.ts b/modules/angular2/src/common/forms/directives/normalize_validator.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/normalize_validator.ts rename to modules/angular2/src/common/forms/directives/normalize_validator.ts diff --git a/modules/angular2/src/core/forms/directives/number_value_accessor.ts b/modules/angular2/src/common/forms/directives/number_value_accessor.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/number_value_accessor.ts rename to modules/angular2/src/common/forms/directives/number_value_accessor.ts diff --git a/modules/angular2/src/core/forms/directives/select_control_value_accessor.ts b/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/select_control_value_accessor.ts rename to modules/angular2/src/common/forms/directives/select_control_value_accessor.ts diff --git a/modules/angular2/src/core/forms/directives/shared.ts b/modules/angular2/src/common/forms/directives/shared.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/shared.ts rename to modules/angular2/src/common/forms/directives/shared.ts diff --git a/modules/angular2/src/core/forms/directives/validators.ts b/modules/angular2/src/common/forms/directives/validators.ts similarity index 100% rename from modules/angular2/src/core/forms/directives/validators.ts rename to modules/angular2/src/common/forms/directives/validators.ts diff --git a/modules/angular2/src/core/forms/form_builder.ts b/modules/angular2/src/common/forms/form_builder.ts similarity index 91% rename from modules/angular2/src/core/forms/form_builder.ts rename to modules/angular2/src/common/forms/form_builder.ts index af827e5324..227894df48 100644 --- a/modules/angular2/src/core/forms/form_builder.ts +++ b/modules/angular2/src/common/forms/form_builder.ts @@ -1,6 +1,6 @@ import {Injectable} from 'angular2/src/core/di'; import {StringMapWrapper} from 'angular2/src/core/facade/collection'; -import {isPresent, isArray} from 'angular2/src/core/facade/lang'; +import {isPresent, isArray, CONST_EXPR, Type} from 'angular2/src/core/facade/lang'; import * as modelModule from './model'; @@ -106,3 +106,19 @@ export class FormBuilder { } } } + +/** + * Shorthand set of providers used for building Angular forms. + * + * ### Example + * + * ```typescript + * bootstrap(MyApp, [FORM_PROVIDERS]); + * ``` + */ +export const FORM_PROVIDERS: Type[] = CONST_EXPR([FormBuilder]); + +/** + * @deprecated + */ +export const FORM_BINDINGS = FORM_PROVIDERS; diff --git a/modules/angular2/src/core/forms/model.ts b/modules/angular2/src/common/forms/model.ts similarity index 100% rename from modules/angular2/src/core/forms/model.ts rename to modules/angular2/src/common/forms/model.ts diff --git a/modules/angular2/src/core/forms/validators.ts b/modules/angular2/src/common/forms/validators.ts similarity index 98% rename from modules/angular2/src/core/forms/validators.ts rename to modules/angular2/src/common/forms/validators.ts index 8f6b2735ba..85c53c45e5 100644 --- a/modules/angular2/src/core/forms/validators.ts +++ b/modules/angular2/src/common/forms/validators.ts @@ -1,9 +1,9 @@ import {isBlank, isPresent, CONST_EXPR} from 'angular2/src/core/facade/lang'; +import {PromiseWrapper} from 'angular2/src/core/facade/promise'; import {ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {OpaqueToken} from 'angular2/src/core/di'; import * as modelModule from './model'; -import {PromiseWrapper} from "../facade/promise"; /** * Providers for validators to be used for {@link Control}s in a form. diff --git a/modules/angular2/src/core/pipes.ts b/modules/angular2/src/common/pipes.ts similarity index 100% rename from modules/angular2/src/core/pipes.ts rename to modules/angular2/src/common/pipes.ts diff --git a/modules/angular2/src/core/pipes/async_pipe.ts b/modules/angular2/src/common/pipes/async_pipe.ts similarity index 100% rename from modules/angular2/src/core/pipes/async_pipe.ts rename to modules/angular2/src/common/pipes/async_pipe.ts diff --git a/modules/angular2/src/common/pipes/common_pipes.ts b/modules/angular2/src/common/pipes/common_pipes.ts new file mode 100644 index 0000000000..3dd8c6605e --- /dev/null +++ b/modules/angular2/src/common/pipes/common_pipes.ts @@ -0,0 +1,25 @@ +/** + * @module + * @description + * This module provides a set of common Pipes. + */ +import {AsyncPipe} from './async_pipe'; +import {UpperCasePipe} from './uppercase_pipe'; +import {LowerCasePipe} from './lowercase_pipe'; +import {JsonPipe} from './json_pipe'; +import {SlicePipe} from './slice_pipe'; +import {DatePipe} from './date_pipe'; +import {DecimalPipe, PercentPipe, CurrencyPipe} from './number_pipe'; +import {CONST_EXPR} from 'angular2/src/core/facade/lang'; + +export const COMMON_PIPES = CONST_EXPR([ + AsyncPipe, + UpperCasePipe, + LowerCasePipe, + JsonPipe, + SlicePipe, + DecimalPipe, + PercentPipe, + CurrencyPipe, + DatePipe +]); diff --git a/modules/angular2/src/core/pipes/date_pipe.ts b/modules/angular2/src/common/pipes/date_pipe.ts similarity index 100% rename from modules/angular2/src/core/pipes/date_pipe.ts rename to modules/angular2/src/common/pipes/date_pipe.ts diff --git a/modules/angular2/src/core/pipes/invalid_pipe_argument_exception.ts b/modules/angular2/src/common/pipes/invalid_pipe_argument_exception.ts similarity index 100% rename from modules/angular2/src/core/pipes/invalid_pipe_argument_exception.ts rename to modules/angular2/src/common/pipes/invalid_pipe_argument_exception.ts diff --git a/modules/angular2/src/core/pipes/json_pipe.ts b/modules/angular2/src/common/pipes/json_pipe.ts similarity index 100% rename from modules/angular2/src/core/pipes/json_pipe.ts rename to modules/angular2/src/common/pipes/json_pipe.ts diff --git a/modules/angular2/src/core/pipes/lowercase_pipe.ts b/modules/angular2/src/common/pipes/lowercase_pipe.ts similarity index 100% rename from modules/angular2/src/core/pipes/lowercase_pipe.ts rename to modules/angular2/src/common/pipes/lowercase_pipe.ts diff --git a/modules/angular2/src/core/pipes/number_pipe.ts b/modules/angular2/src/common/pipes/number_pipe.ts similarity index 100% rename from modules/angular2/src/core/pipes/number_pipe.ts rename to modules/angular2/src/common/pipes/number_pipe.ts diff --git a/modules/angular2/src/core/pipes/slice_pipe.ts b/modules/angular2/src/common/pipes/slice_pipe.ts similarity index 98% rename from modules/angular2/src/core/pipes/slice_pipe.ts rename to modules/angular2/src/common/pipes/slice_pipe.ts index cb69a3ceae..f636f762f3 100644 --- a/modules/angular2/src/core/pipes/slice_pipe.ts +++ b/modules/angular2/src/common/pipes/slice_pipe.ts @@ -6,7 +6,7 @@ import {Injectable} from 'angular2/src/core/di'; import {PipeTransform, WrappedValue} from 'angular2/src/core/change_detection'; import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception'; -import {Pipe} from '../metadata'; +import {Pipe} from 'angular2/src/core/metadata'; /** * Creates a new List or String containing only a subset (slice) of the diff --git a/modules/angular2/src/core/pipes/uppercase_pipe.ts b/modules/angular2/src/common/pipes/uppercase_pipe.ts similarity index 100% rename from modules/angular2/src/core/pipes/uppercase_pipe.ts rename to modules/angular2/src/common/pipes/uppercase_pipe.ts diff --git a/modules/angular2/src/core/application_common.ts b/modules/angular2/src/core/application_common.ts index 548a244e7a..83d44f0bb6 100644 --- a/modules/angular2/src/core/application_common.ts +++ b/modules/angular2/src/core/application_common.ts @@ -1,4 +1,4 @@ -import {FORM_PROVIDERS} from 'angular2/src/core/forms'; +import {FORM_PROVIDERS} from 'angular2/src/common/forms'; import {provide, Provider} from 'angular2/src/core/di'; import {Type, isBlank, isPresent, stringify} from 'angular2/src/core/facade/lang'; import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter'; diff --git a/modules/angular2/src/web_workers/worker/application_common.ts b/modules/angular2/src/web_workers/worker/application_common.ts index e2835f9a1b..85919df216 100644 --- a/modules/angular2/src/web_workers/worker/application_common.ts +++ b/modules/angular2/src/web_workers/worker/application_common.ts @@ -1,5 +1,5 @@ import {Injector, provide, OpaqueToken, Provider} from 'angular2/src/core/di'; -import {FORM_PROVIDERS} from 'angular2/src/core/forms'; +import {FORM_PROVIDERS} from 'angular2/src/common/forms'; import { NumberWrapper, Type, diff --git a/modules/angular2/test/core/directives/ng_class_spec.ts b/modules/angular2/test/common/directives/ng_class_spec.ts similarity index 99% rename from modules/angular2/test/core/directives/ng_class_spec.ts rename to modules/angular2/test/common/directives/ng_class_spec.ts index 75c74f96fb..f9350c3744 100644 --- a/modules/angular2/test/core/directives/ng_class_spec.ts +++ b/modules/angular2/test/common/directives/ng_class_spec.ts @@ -16,7 +16,7 @@ import { } from 'angular2/testing_internal'; import {ListWrapper, StringMapWrapper, SetWrapper} from 'angular2/src/core/facade/collection'; import {Component, View, NgFor, provide} from 'angular2/angular2'; -import {NgClass} from 'angular2/src/core/directives/ng_class'; +import {NgClass} from 'angular2/src/common/directives/ng_class'; import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/linker/view_pool'; function detectChangesAndCheck(fixture: ComponentFixture, classes: string, elIndex: number = 0) { diff --git a/modules/angular2/test/core/directives/ng_for_spec.ts b/modules/angular2/test/common/directives/ng_for_spec.ts similarity index 99% rename from modules/angular2/test/core/directives/ng_for_spec.ts rename to modules/angular2/test/common/directives/ng_for_spec.ts index fba09d3126..62db277763 100644 --- a/modules/angular2/test/core/directives/ng_for_spec.ts +++ b/modules/angular2/test/common/directives/ng_for_spec.ts @@ -17,7 +17,7 @@ import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Component, View, TemplateRef, ContentChild} from 'angular2/angular2'; -import {NgFor} from 'angular2/src/core/directives/ng_for'; +import {NgFor} from 'angular2/src/common/directives/ng_for'; export function main() { diff --git a/modules/angular2/test/core/directives/ng_if_spec.ts b/modules/angular2/test/common/directives/ng_if_spec.ts similarity index 100% rename from modules/angular2/test/core/directives/ng_if_spec.ts rename to modules/angular2/test/common/directives/ng_if_spec.ts diff --git a/modules/angular2/test/core/directives/ng_style_spec.ts b/modules/angular2/test/common/directives/ng_style_spec.ts similarity index 98% rename from modules/angular2/test/core/directives/ng_style_spec.ts rename to modules/angular2/test/common/directives/ng_style_spec.ts index 0530a4d788..1c07e8d551 100644 --- a/modules/angular2/test/core/directives/ng_style_spec.ts +++ b/modules/angular2/test/common/directives/ng_style_spec.ts @@ -19,7 +19,7 @@ import {StringMapWrapper} from 'angular2/src/core/facade/collection'; import {Component, View} from 'angular2/angular2'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {NgStyle} from 'angular2/src/core/directives/ng_style'; +import {NgStyle} from 'angular2/src/common/directives/ng_style'; export function main() { describe('binding to CSS styles', () => { diff --git a/modules/angular2/test/core/directives/ng_switch_spec.ts b/modules/angular2/test/common/directives/ng_switch_spec.ts similarity index 99% rename from modules/angular2/test/core/directives/ng_switch_spec.ts rename to modules/angular2/test/common/directives/ng_switch_spec.ts index 4f1246f904..5a04be44b4 100644 --- a/modules/angular2/test/core/directives/ng_switch_spec.ts +++ b/modules/angular2/test/common/directives/ng_switch_spec.ts @@ -14,7 +14,7 @@ import { import {Component, View} from 'angular2/angular2'; -import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/src/core/directives/ng_switch'; +import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/src/common/directives/ng_switch'; export function main() { describe('switch', () => { diff --git a/modules/angular2/test/core/directives/non_bindable_spec.ts b/modules/angular2/test/common/directives/non_bindable_spec.ts similarity index 100% rename from modules/angular2/test/core/directives/non_bindable_spec.ts rename to modules/angular2/test/common/directives/non_bindable_spec.ts diff --git a/modules/angular2/test/core/directives/observable_list_diff_spec.dart b/modules/angular2/test/common/directives/observable_list_diff_spec.dart similarity index 100% rename from modules/angular2/test/core/directives/observable_list_diff_spec.dart rename to modules/angular2/test/common/directives/observable_list_diff_spec.dart diff --git a/modules/angular2/test/core/forms/directives_spec.ts b/modules/angular2/test/common/forms/directives_spec.ts similarity index 99% rename from modules/angular2/test/core/forms/directives_spec.ts rename to modules/angular2/test/common/forms/directives_spec.ts index f585699325..63edab382e 100644 --- a/modules/angular2/test/core/forms/directives_spec.ts +++ b/modules/angular2/test/common/forms/directives_spec.ts @@ -17,7 +17,6 @@ import { import {SpyNgControl, SpyValueAccessor} from '../spies'; - import { ControlGroup, Control, @@ -38,7 +37,7 @@ import { } from 'angular2/core'; -import {selectValueAccessor, composeValidators} from 'angular2/src/core/forms/directives/shared'; +import {selectValueAccessor, composeValidators} from 'angular2/src/common/forms/directives/shared'; import {TimerWrapper} from 'angular2/src/core/facade/async'; import {PromiseWrapper} from 'angular2/src/core/facade/promise'; import {SimpleChange} from 'angular2/src/core/change_detection'; diff --git a/modules/angular2/test/core/forms/form_builder_spec.ts b/modules/angular2/test/common/forms/form_builder_spec.ts similarity index 100% rename from modules/angular2/test/core/forms/form_builder_spec.ts rename to modules/angular2/test/common/forms/form_builder_spec.ts diff --git a/modules/angular2/test/core/forms/integration_spec.ts b/modules/angular2/test/common/forms/integration_spec.ts similarity index 100% rename from modules/angular2/test/core/forms/integration_spec.ts rename to modules/angular2/test/common/forms/integration_spec.ts diff --git a/modules/angular2/test/core/forms/model_spec.ts b/modules/angular2/test/common/forms/model_spec.ts similarity index 100% rename from modules/angular2/test/core/forms/model_spec.ts rename to modules/angular2/test/common/forms/model_spec.ts diff --git a/modules/angular2/test/core/forms/validators_spec.ts b/modules/angular2/test/common/forms/validators_spec.ts similarity index 100% rename from modules/angular2/test/core/forms/validators_spec.ts rename to modules/angular2/test/common/forms/validators_spec.ts diff --git a/modules/angular2/test/core/pipes/async_pipe_spec.ts b/modules/angular2/test/common/pipes/async_pipe_spec.ts similarity index 99% rename from modules/angular2/test/core/pipes/async_pipe_spec.ts rename to modules/angular2/test/common/pipes/async_pipe_spec.ts index 5c3f570475..3f7a20c9b2 100644 --- a/modules/angular2/test/core/pipes/async_pipe_spec.ts +++ b/modules/angular2/test/common/pipes/async_pipe_spec.ts @@ -9,10 +9,9 @@ import { afterEach, AsyncTestCompleter, inject, - SpyObject, browserDetection } from 'angular2/testing_internal'; -import {SpyChangeDetectorRef} from './spies'; +import {SpyChangeDetectorRef} from '../spies'; import {isBlank} from 'angular2/src/core/facade/lang'; import {AsyncPipe, WrappedValue} from 'angular2/core'; diff --git a/modules/angular2/test/core/pipes/date_pipe_spec.ts b/modules/angular2/test/common/pipes/date_pipe_spec.ts similarity index 100% rename from modules/angular2/test/core/pipes/date_pipe_spec.ts rename to modules/angular2/test/common/pipes/date_pipe_spec.ts diff --git a/modules/angular2/test/core/pipes/json_pipe_spec.ts b/modules/angular2/test/common/pipes/json_pipe_spec.ts similarity index 99% rename from modules/angular2/test/core/pipes/json_pipe_spec.ts rename to modules/angular2/test/common/pipes/json_pipe_spec.ts index 4ae8ea5280..cf94ca62ef 100644 --- a/modules/angular2/test/core/pipes/json_pipe_spec.ts +++ b/modules/angular2/test/common/pipes/json_pipe_spec.ts @@ -10,7 +10,6 @@ import { AsyncTestCompleter, inject, proxy, - SpyObject, TestComponentBuilder } from 'angular2/testing_internal'; import {Json, RegExp, NumberWrapper, StringWrapper} from 'angular2/src/core/facade/lang'; diff --git a/modules/angular2/test/core/pipes/lowercase_pipe_spec.ts b/modules/angular2/test/common/pipes/lowercase_pipe_spec.ts similarity index 100% rename from modules/angular2/test/core/pipes/lowercase_pipe_spec.ts rename to modules/angular2/test/common/pipes/lowercase_pipe_spec.ts diff --git a/modules/angular2/test/core/pipes/number_pipe_spec.ts b/modules/angular2/test/common/pipes/number_pipe_spec.ts similarity index 100% rename from modules/angular2/test/core/pipes/number_pipe_spec.ts rename to modules/angular2/test/common/pipes/number_pipe_spec.ts diff --git a/modules/angular2/test/core/pipes/pipe_binding_spec.ts b/modules/angular2/test/common/pipes/pipe_binding_spec.ts similarity index 100% rename from modules/angular2/test/core/pipes/pipe_binding_spec.ts rename to modules/angular2/test/common/pipes/pipe_binding_spec.ts diff --git a/modules/angular2/test/core/pipes/pipes_spec.ts b/modules/angular2/test/common/pipes/pipes_spec.ts similarity index 100% rename from modules/angular2/test/core/pipes/pipes_spec.ts rename to modules/angular2/test/common/pipes/pipes_spec.ts diff --git a/modules/angular2/test/core/pipes/slice_pipe_spec.ts b/modules/angular2/test/common/pipes/slice_pipe_spec.ts similarity index 100% rename from modules/angular2/test/core/pipes/slice_pipe_spec.ts rename to modules/angular2/test/common/pipes/slice_pipe_spec.ts diff --git a/modules/angular2/test/core/pipes/uppercase_pipe_spec.ts b/modules/angular2/test/common/pipes/uppercase_pipe_spec.ts similarity index 100% rename from modules/angular2/test/core/pipes/uppercase_pipe_spec.ts rename to modules/angular2/test/common/pipes/uppercase_pipe_spec.ts diff --git a/modules/angular2/test/common/spies.dart b/modules/angular2/test/common/spies.dart new file mode 100644 index 0000000000..50b75e95ab --- /dev/null +++ b/modules/angular2/test/common/spies.dart @@ -0,0 +1,20 @@ +library core.spies; + +import 'package:angular2/common.dart'; +import 'package:angular2/src/core/change_detection/change_detection.dart'; +import 'package:angular2/testing_internal.dart'; + +@proxy +class SpyNgControl extends SpyObject implements NgControl { + noSuchMethod(m) => super.noSuchMethod(m); +} + +@proxy +class SpyValueAccessor extends SpyObject implements ControlValueAccessor { + noSuchMethod(m) => super.noSuchMethod(m); +} + +@proxy +class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef { + noSuchMethod(m) => super.noSuchMethod(m); +} diff --git a/modules/angular2/test/core/pipes/spies.ts b/modules/angular2/test/common/spies.ts similarity index 71% rename from modules/angular2/test/core/pipes/spies.ts rename to modules/angular2/test/common/spies.ts index 0309db58c0..65d5a047e5 100644 --- a/modules/angular2/test/core/pipes/spies.ts +++ b/modules/angular2/test/common/spies.ts @@ -1,7 +1,10 @@ import {ChangeDetectorRef_} from 'angular2/src/core/change_detection/change_detector_ref'; - import {SpyObject, proxy} from 'angular2/testing_internal'; export class SpyChangeDetectorRef extends SpyObject { constructor() { super(ChangeDetectorRef_); } -} \ No newline at end of file +} + +export class SpyNgControl extends SpyObject {} + +export class SpyValueAccessor extends SpyObject {} diff --git a/modules/angular2/test/core/pipes/spies.dart b/modules/angular2/test/core/pipes/spies.dart deleted file mode 100644 index 0695c665a9..0000000000 --- a/modules/angular2/test/core/pipes/spies.dart +++ /dev/null @@ -1,9 +0,0 @@ -library pipes.spies; - -import 'package:angular2/src/core/change_detection/change_detection.dart'; -import 'package:angular2/testing_internal.dart'; - -@proxy -class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef { - noSuchMethod(m) => super.noSuchMethod(m); -} diff --git a/modules/angular2/test/core/spies.dart b/modules/angular2/test/core/spies.dart index e7f4852cb4..90a5e936d6 100644 --- a/modules/angular2/test/core/spies.dart +++ b/modules/angular2/test/core/spies.dart @@ -106,14 +106,4 @@ class SpyDomAdapter extends SpyObject implements DomAdapter { class SpyRenderEventDispatcher extends SpyObject implements RenderEventDispatcher { noSuchMethod(m) => super.noSuchMethod(m); -} - -@proxy -class SpyNgControl extends SpyObject implements NgControl { - noSuchMethod(m) => super.noSuchMethod(m); -} - -@proxy -class SpyValueAccessor extends SpyObject implements ControlValueAccessor { - noSuchMethod(m) => super.noSuchMethod(m); -} +} \ No newline at end of file diff --git a/modules/angular2/test/core/spies.ts b/modules/angular2/test/core/spies.ts index baea3c17f1..f608eb7d17 100644 --- a/modules/angular2/test/core/spies.ts +++ b/modules/angular2/test/core/spies.ts @@ -105,8 +105,4 @@ export class SpyRenderEventDispatcher extends SpyObject { super(); this.spy('dispatchRenderEvent'); } -} - -export class SpyNgControl extends SpyObject {} - -export class SpyValueAccessor extends SpyObject {} +} \ No newline at end of file diff --git a/modules/angular2/web_worker/worker.ts b/modules/angular2/web_worker/worker.ts index fef8e01c46..60ba396191 100644 --- a/modules/angular2/web_worker/worker.ts +++ b/modules/angular2/web_worker/worker.ts @@ -2,7 +2,7 @@ export * from '../lifecycle_hooks'; export * from '../src/core/metadata'; export * from '../src/core/util'; export * from '../src/core/di'; -export * from '../src/core/pipes'; +export * from '../src/common/pipes'; export * from '../src/core/facade'; // Do not export application in web_worker, // web_worker exports its own @@ -32,8 +32,8 @@ export { RenderEmbeddedTemplateCmd, RenderBeginCmd } from '../src/core/render/render'; -export * from '../src/core/directives'; -export * from '../src/core/forms'; +export * from '../src/common/directives'; +export * from '../src/common/forms'; export * from '../src/core/debug'; export * from '../src/core/change_detection'; diff --git a/modules/playground/pubspec.yaml b/modules/playground/pubspec.yaml index f65b56dfc8..5659aff382 100644 --- a/modules/playground/pubspec.yaml +++ b/modules/playground/pubspec.yaml @@ -17,7 +17,7 @@ dependency_overrides: path: ../angular2_material transformers: - angular2: - ambient_directives: 'package:angular2/src/core/directives.dart#CORE_DIRECTIVES' + ambient_directives: 'package:angular2/src/common/directives.dart#CORE_DIRECTIVES' entry_points: - web/src/gestures/index.dart - web/src/hello_world/index.dart diff --git a/modules_dart/transform/lib/src/transform/common/options.dart b/modules_dart/transform/lib/src/transform/common/options.dart index 7d1ca8da8c..a3ea7a138a 100644 --- a/modules_dart/transform/lib/src/transform/common/options.dart +++ b/modules_dart/transform/lib/src/transform/common/options.dart @@ -41,7 +41,7 @@ class TransformerOptions { final bool reflectPropertiesAsAttributes; /// A set of directives that will be automatically passed-in to the template compiler - /// Format of an item in the list: angular2/lib/src/core/directives.dart#CORE_DIRECTIVES + /// Format of an item in the list: angular2/lib/src/common/directives.dart#CORE_DIRECTIVES final List ambientDirectives; /// Whether to format generated code. diff --git a/modules_dart/transform/test/transform/common/compile_directive_metadata/ng_for.ng_meta.dart b/modules_dart/transform/test/transform/common/compile_directive_metadata/ng_for.ng_meta.dart index d25f805a46..60f434db5d 100644 --- a/modules_dart/transform/test/transform/common/compile_directive_metadata/ng_for.ng_meta.dart +++ b/modules_dart/transform/test/transform/common/compile_directive_metadata/ng_for.ng_meta.dart @@ -11,7 +11,7 @@ final ngFor = { "type": { "id": 9999, "name": "NgFor", - "moduleUrl": "asset:angular2/lib/src/core/directives/ng_for.dart" + "moduleUrl": "asset:angular2/lib/src/common/directives/ng_for.dart" }, "changeDetection": null, "inputs": {"ngForOf": "ngForOf"}, diff --git a/tools/broccoli/trees/node_tree.ts b/tools/broccoli/trees/node_tree.ts index fde5e89a43..5932608acb 100644 --- a/tools/broccoli/trees/node_tree.ts +++ b/tools/broccoli/trees/node_tree.ts @@ -25,7 +25,7 @@ module.exports = function makeNodeTree(destinationPath) { 'angular2/test/testing/fake_async_spec.ts', 'angular2/test/testing/testing_public_spec.ts', 'angular2/test/compiler/xhr_impl_spec.ts', - 'angular2/test/core/forms/**', + 'angular2/test/common/forms/**', 'angular2/test/tools/tools_spec.ts', 'angular1_router/**', 'angular2/examples/**/!(*_spec.ts)',