X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/angular2/docs/cheatsheet/bootstrapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bootstrapping
@description
{@target ts}`import {bootstrap} from 'angular2/platform/browser';`{@endtarget}
{@target js}Available from the `ng.platform.browser` namespace{@endtarget}
{@target dart}`import 'package:angular2/bootstrap.dart';`{@endtarget}
{@target dart}`import 'package:angular2/platform/browser.dart';`{@endtarget}

@cheatsheetItem
syntax(ts dart):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {UrlResolver} from 'angular2/compiler';

var MyApp: any;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {NG_VALIDATORS} from 'angular2/common';
import {Provider} from 'angular2/core';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Observable, Subscriber} from 'rxjs/Rx';

// #docregion AsyncPipe
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

// #docregion DatePipe
@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

// #docregion JsonPipe
@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

// #docregion LowerUpperPipe
@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

// #docregion NumberPipe
@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

// #docregion SlicePipe_string
@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// #docregion enableProdMode
import {enableProdMode} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {MyComponent} from './my_component';

enableProdMode();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {provide, Component} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
CanActivate,
RouteConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {provide, Component} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
CanDeactivate,
RouteConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
OnActivate,
ComponentInstruction,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, Injectable, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
OnDeactivate,
ComponentInstruction,
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/examples/router/ts/reuse/reuse_example.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
CanActivate,
RouteConfig,
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/compiler/compiler_benchmark.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {BrowserDomAdapter} from 'angular2/src/platform/browser/browser_adapter';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {PromiseWrapper} from 'angular2/src/facade/async';
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/costs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component, Directive, DynamicComponentLoader, ElementRef} from 'angular2/core';
import {NgIf, NgFor} from 'angular2/common';
import {ApplicationRef} from 'angular2/src/core/application_ref';
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/largetable/largetable_benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
windowProfile,
windowProfileEnd
} from 'angular2/src/testing/benchmark_util';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component, Directive, bind, provide} from 'angular2/core';
import {NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/common';
import {ApplicationRef} from 'angular2/src/core/application_ref';
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/naive_infinite_scroll/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

import {App} from './app';

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/static_tree/tree_benchmark.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {NgIf} from 'angular2/common';
import {
Compiler,
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/tree/tree_benchmark.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
Compiler,
Component,
Expand Down
2 changes: 1 addition & 1 deletion modules/payload_tests/hello_world/ts/webpack/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

@Component({
selector: 'hello-app',
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/animate/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {AnimateApp} from './animate-app';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

export function main() {
bootstrap(AnimateApp);
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/async/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';
import {NgIf} from 'angular2/common';
import {TimerWrapper} from 'angular2/src/facade/async';
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/gestures/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';

@Component({selector: 'gestures-app', templateUrl: 'template.html'})
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/hash_routing/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
RouteConfig,
Route,
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/hello_world/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Renderer, ElementRef, Component, Directive, Injectable} from 'angular2/core';

export function main() {
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/http/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {HTTP_PROVIDERS} from 'angular2/http';
import {HttpCmp} from './http_comp';

Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/jsonp/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {JSONP_PROVIDERS} from 'angular2/http';
import {JsonpCmp} from './jsonp_comp';

Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/key_events/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';
import {KeyEventsPlugin} from 'angular2/src/platform/dom/events/key_events';

Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/model_driven_forms/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
FORM_DIRECTIVES,
ControlGroup,
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/order_management/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {
Component,
Directive,
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/person_management/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component, Directive, Host, forwardRef, Provider, Injectable} from 'angular2/core';
import {NgIf, NgFor, FORM_DIRECTIVES} from 'angular2/common';

Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/relative_assets/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';

import {Renderer, ElementRef, Component, Directive, Injectable} from 'angular2/core';
import {MyCmp} from './my_cmp/my_cmp';
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/routing/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {InboxApp} from './inbox-app';
import {provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {ROUTER_PROVIDERS, HashLocationStrategy, LocationStrategy} from 'angular2/router';

export function main() {
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/sourcemap/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';

@Component({
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/svg/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';

@Component({selector: '[svg-group]', template: `<svg:text x="20" y="20">Hello</svg:text>`})
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/template_driven_forms/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component, Directive, Host, forwardRef, Provider} from 'angular2/core';
import {
ControlGroup,
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/todo/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';
import {NgFor} from 'angular2/common';
import {Store, Todo, TodoFactory} from './services/TodoStore';
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/web_workers/images/single_thread.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from "angular2/bootstrap";
import {bootstrap} from "angular2/platform/browser";
import {ImageDemo} from "./index_common";

export function main() {
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/zippy_component/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';
import {Zippy} from './zippy';

Expand Down
3 changes: 2 additions & 1 deletion modules_dart/payload/hello_world/web/index.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library hello_world.index;

import "package:angular2/bootstrap.dart" show AngularEntrypoint, bootstrap;
import "package:angular2/platform/browser.dart"
show AngularEntrypoint, bootstrap;
import "package:angular2/angular2.dart"
show Component, Directive, ElementRef, Injectable, Renderer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,29 @@ library angular2.transform.common.mirror_matcher;
import 'package:analyzer/src/generated/ast.dart';
import 'package:angular2/src/transform/common/names.dart';

const BOOTSTRAP_STATIC_URI = 'package:angular2/bootstrap_static.dart';
const BOOTSTRAP_URI = 'package:angular2/bootstrap.dart';
const REFLECTION_CAPABILITIES_URI =
/// Files from which `bootstrap` is exported.
///
/// These files transitively imports dart:mirrors.
/// They should be replaced with [BOOTSTRAP_STATIC_URI] in production apps.
const _BOOTSTRAP_URIS = const <String>[
'package:angular2/bootstrap.dart',
'package:angular2/platform/browser.dart',
];

/// File from which `ReflectionCapabilities` is exported.
///
/// This file transitively imports dart:mirrors and should be removed from
/// production apps. The Angular2 reflection framework should be initialized
/// with generated code such that no reflection is necessary.
const _REFLECTION_CAPABILITIES_URI =
'package:angular2/src/core/reflection/reflection_capabilities.dart';

/// File from which `bootstrapStatic` is exported.
///
/// This file does not transitively import dart:mirrors.
/// It should be used in place of [_BOOTSTRAP_URIS] in production apps.
const BOOTSTRAP_STATIC_URI = 'package:angular2/platform/browser_static.dart';

/// Syntactially checks for code related to the use of `dart:mirrors`.
///
/// Checks various [AstNode]s to determine if they are
Expand All @@ -20,10 +38,9 @@ class MirrorMatcher {
'${node.constructorName.type.name}' == REFLECTION_CAPABILITIES_NAME;

bool hasReflectionCapabilitiesUri(UriBasedDirective node) {
return node.uri.stringValue == REFLECTION_CAPABILITIES_URI;
return node.uri.stringValue == _REFLECTION_CAPABILITIES_URI;
}

bool hasBootstrapUri(UriBasedDirective node) {
return node.uri.stringValue == BOOTSTRAP_URI;
}
bool hasBootstrapUri(UriBasedDirective node) =>
_BOOTSTRAP_URIS.contains(node.uri.stringValue);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library web_foo;

import 'package:angular2/bootstrap.dart';
import 'package:angular2/platform/browser.dart';
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
import 'bar.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library web_foo;

import 'package:angular2/bootstrap.dart';
import 'package:angular2/platform/browser.dart';
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
import 'bar.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library web_foo;

import 'package:angular2/bootstrap.dart';
import 'package:angular2/platform/browser.dart';
import 'package:angular2/src/core/reflection/reflection.dart';
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
import 'bar.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library web_foo;

import 'package:angular2/bootstrap.dart';
import 'package:angular2/platform/browser.dart';
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
import 'bar.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ library web_foo.template.dart;

import 'index.dart';
import 'package:angular2/src/core/reflection/reflection.dart' as _ngRef;
import 'package:angular2/bootstrap_static.dart' show bootstrapStatic;
import 'package:angular2/platform/browser_static.dart' show bootstrapStatic;
import 'package:angular2/src/core/reflection/reflection.dart';
import 'bar.dart';
import 'bar.template.dart' as i0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library web_foo;

import 'package:angular2/bootstrap.dart' show bootstrap;
import 'package:angular2/platform/browser.dart' show bootstrap;
import 'package:angular2/src/core/reflection/reflection.dart';
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
import 'bar.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library web_foo;

import 'package:angular2/bootstrap.dart';
import 'package:angular2/platform/browser.dart';
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
import 'bar.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library web_foo;

import 'package:angular2/bootstrap.dart';
import 'package:angular2/platform/browser.dart';
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
import 'bar.dart';

Expand Down
Loading
X Tutup