diff --git a/modules/angular2/angular2.dart b/modules/angular2/angular2.dart index 38c6812a65..0712972173 100644 --- a/modules/angular2/angular2.dart +++ b/modules/angular2/angular2.dart @@ -9,10 +9,11 @@ export 'package:angular2/core.dart' hide forwardRef, resolveForwardRef, ForwardRefFn; export 'package:angular2/common.dart'; export 'package:angular2/instrumentation.dart'; +export 'package:angular2/src/core/angular_entrypoint.dart' show AngularEntrypoint; export 'package:angular2/src/core/application_tokens.dart' hide APP_COMPONENT_REF_PROMISE, APP_ID_RANDOM_PROVIDER; export 'package:angular2/src/platform/dom/dom_tokens.dart'; export 'package:angular2/src/platform/dom/dom_adapter.dart'; export 'package:angular2/src/platform/dom/events/event_manager.dart'; export 'package:angular2/src/compiler/url_resolver.dart'; -export 'package:angular2/src/compiler/app_root_url.dart'; \ No newline at end of file +export 'package:angular2/src/compiler/app_root_url.dart'; diff --git a/modules/angular2/bootstrap.ts b/modules/angular2/bootstrap.ts index d7c24b6848..b0cfb24d78 100644 --- a/modules/angular2/bootstrap.ts +++ b/modules/angular2/bootstrap.ts @@ -3,3 +3,4 @@ * @deprecated */ export {bootstrap} from 'angular2/platform/browser'; +export {AngularEntrypoint} from 'angular2/src/core/angular_entrypoint'; diff --git a/modules/angular2/bootstrap_static.ts b/modules/angular2/bootstrap_static.ts index a3a242aff7..8648d92bc2 100644 --- a/modules/angular2/bootstrap_static.ts +++ b/modules/angular2/bootstrap_static.ts @@ -3,3 +3,4 @@ * @deprecated */ export {bootstrapStatic} from 'angular2/platform/browser_static'; +export {AngularEntrypoint} from 'angular2/src/core/angular_entrypoint'; diff --git a/modules/angular2/platform/browser.ts b/modules/angular2/platform/browser.ts index 3f261bc2da..327645623e 100644 --- a/modules/angular2/platform/browser.ts +++ b/modules/angular2/platform/browser.ts @@ -1,3 +1,4 @@ +export {AngularEntrypoint} from 'angular2/src/core/angular_entrypoint'; export { BROWSER_PROVIDERS, ELEMENT_PROBE_BINDINGS, @@ -124,4 +125,4 @@ export function bootstrap( let appProviders = isPresent(customProviders) ? [BROWSER_APP_PROVIDERS, customProviders] : BROWSER_APP_PROVIDERS; return platform(BROWSER_PROVIDERS).application(appProviders).bootstrap(appComponentType); -} \ No newline at end of file +} diff --git a/modules/angular2/platform/browser_static.ts b/modules/angular2/platform/browser_static.ts index 8c99b20214..732b08bf11 100644 --- a/modules/angular2/platform/browser_static.ts +++ b/modules/angular2/platform/browser_static.ts @@ -1,3 +1,4 @@ +export {AngularEntrypoint} from 'angular2/src/core/angular_entrypoint'; export { BROWSER_PROVIDERS, ELEMENT_PROBE_BINDINGS, @@ -10,13 +11,13 @@ export { disableDebugTools } from 'angular2/src/platform/browser_common'; -import {Type, isPresent, CONST_EXPR} from 'angular2/src/facade/lang'; +import {Type, isPresent} from 'angular2/src/facade/lang'; import {Promise} from 'angular2/src/facade/promise'; import { BROWSER_PROVIDERS, BROWSER_APP_COMMON_PROVIDERS } from 'angular2/src/platform/browser_common'; -import {ComponentRef, platform, reflector} from 'angular2/core'; +import {ComponentRef, platform} from 'angular2/core'; /** * An array of providers that should be passed into `application()` when bootstrapping a component @@ -39,4 +40,4 @@ export function bootstrapStatic(appComponentType: Type, let appProviders = isPresent(customProviders) ? [BROWSER_APP_PROVIDERS, customProviders] : BROWSER_APP_PROVIDERS; return platform(BROWSER_PROVIDERS).application(appProviders).bootstrap(appComponentType); -} \ No newline at end of file +} diff --git a/modules/angular2/src/core/angular_entrypoint.ts b/modules/angular2/src/core/angular_entrypoint.ts new file mode 100644 index 0000000000..1aaf532788 --- /dev/null +++ b/modules/angular2/src/core/angular_entrypoint.ts @@ -0,0 +1,22 @@ +import {CONST} from 'angular2/src/facade/lang'; + +/** + * Marks a function or method as an Angular 2 entrypoint. Only necessary in Dart code. + * + * The optional `name` parameter will be reflected in logs when the entry point is processed. + * + * See [the wiki][] for detailed documentation. + * [the wiki]: https://github.com/angular/angular/wiki/Angular-2-Dart-Transformer#entry_points + * + * ## Example + * + * ``` + * @AngularEntrypoint("name-for-debug") + * void main() { + * bootstrap(MyComponent); + * } + */ +@CONST() +export class AngularEntrypoint { + constructor(public name?: String) {} +} diff --git a/modules/angular2/test/public_api_spec.ts b/modules/angular2/test/public_api_spec.ts index 199741fd8b..966154e863 100644 --- a/modules/angular2/test/public_api_spec.ts +++ b/modules/angular2/test/public_api_spec.ts @@ -76,6 +76,8 @@ var NG_ALL = [ 'AbstractControlDirective.valid', 'AbstractControlDirective.value', 'AbstractControlDirective.path', + 'AngularEntrypoint', + 'AngularEntrypoint.name', 'AppRootUrl', 'AppRootUrl.value', 'AppRootUrl.value=',