Go to file
Jason Teplitz 1710272b3c refactor(WebWorker): Use the new generic bootstrap.
BREAKING CHANGE:

You can no longer bootstrap a WebWorker or Isolate using `bootstrap` or `bootstrapWebWorker`. Instead you have to do the following:

In TypeScript:
```TypeScript
// index.js
import {WORKER_RENDER_PLATFORM, WORKER_RENDER_APPLICATION, WORKER_SCRIPT} from "angular2/platforms/worker_render";
import {platform} from "angular2/platform";

platform([WORKER_RENDER_PLATFORM])
.application([WORKER_RENDER_APPLICATION, new Provider(WORKER_SCRIPT, {useValue: "loader.js"});
```
```JavaScript
// loader.js
importScripts("https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.3/es6-shim.js", "https://jspm.io/system@0.16.js", "angular2/web_worker/worker.js");
System.import("app");
```
```TypeScript
// app.ts
import {Component, View} from "angular2/core";
import {WORKER_APP_PLATFORM, setupWebWorker} from "angular2/platforms/worker_app";
import {platform} from "angular2/platform";

@Component({
  selector: "hello-world"
})
@View({
  template: "<h1>Hello {{name}}</h1>
})
export class HelloWorld {
  name: string = "Jane";
}

platform([WORKER_APP_PLATFORM])
.asyncApplication(setupWebWorker, optionalProviders?)
.then((ref) => ref.bootstrap(RootComponent));
```

In Dart:
```Dart
// index.dart
import "angular2/platform.dart";
import "angular2/platforms/worker_render.dart";

main() {
  platform([WORKER_RENDER_PLATFORM])
  .asyncApplication(initIsolate("my_worker.dart"));
}
```
```Dart
// background_index.dart
import "angular2/platform.dart";
import "angular2/platforms/worker_app.dart";
import "package:angular2/src/core/reflection/reflection.dart";
import "package:angular2/src/core/reflection/reflection_capabilities.dart";

@Component(
  selector: "hello-world"
)
@View(
  template: "<h1>Hello {{name}}</h1>"
)
class HelloWorld {
  String name = "Jane";
}

main(List<String> args, SendPort replyTo) {
  reflector.reflectionCapabilities = new ReflectionCapabilities();
  platform([WORKER_APP_PLATFORM])
    .asyncApplication(setupIsolate(replyTo))
      .then((ref) => ref.bootstrap(RootComponent));
}

```

You should no longer import from the `angular2/web_worker/worker` and `angular2/web_worker/ui` paths. Instead you can now import directly from core, directives, etc..

The WebWorkerApplication class has been removed. If you want to use ServiceMessageBroker or ClientMessageBroker on the render thread, you must inject their factories via DI.
If you need to use the MessageBus on the render thread you must also obtain it through DI.

closes #3277
closes #5473

Closes #5519
2015-12-03 19:51:43 +00:00
modules refactor(WebWorker): Use the new generic bootstrap. 2015-12-03 19:51:43 +00:00
modules_dart feat(test): add angular2_testing dart library 2015-12-03 11:33:46 -08:00
scripts fix(build): change npm publish script not to remove angular folder when building benchpress 2015-12-01 12:42:54 -08:00
tools refactor(facade): use rxjs package 2015-12-02 16:02:34 -08:00
typing_spec chore(typings): add router_spec to test.typings 2015-10-30 20:28:56 +00:00
.bowerrc chore(dgeni): clean up legacy typings bundle creation 2015-10-29 21:19:59 +00:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig chore(.editorconfig): include markdown config 2015-01-27 00:14:48 -08:00
.gitattributes chore: add .gitattributes with new lines config 2015-01-06 18:06:13 -08:00
.gitignore chore(analytics): Build hello_world, check constraints 2015-11-23 20:10:04 +00:00
.nvmrc build(node): update node from 4.1.1 to 4.2.1 2015-10-27 14:15:54 +00:00
.travis.yml chore(analytics): Travis job testing Dart payload size 2015-11-23 20:10:04 +00:00
CHANGELOG.md chore(changelog): add lifecycle breaking changes 2015-12-02 14:19:47 -08:00
COMMITTER.md chore(docs): explain the process for merging changes to master 2015-08-11 21:28:46 +00:00
CONTRIBUTING.md docs(CONTRIBUTING): sync with the change of angular/angular.js#12032 2015-08-04 19:54:31 +00:00
DEVELOPER.md docs(DEVELOPER.md): update info about clang-format setup 2015-11-13 22:50:38 +00:00
LICENSE Initial commit 2014-09-18 09:12:01 -07:00
NAMING.md refactor(ngProbe): rename to ng.probe 2015-08-31 21:32:10 +00:00
README.md chore(saucelabs): add matrix badge to README.md 2015-09-29 10:03:45 +02:00
TOOLS.md feat(docs): document change detection profiler 2015-09-04 16:38:53 -07:00
TOOLS_DART.md docs: edit DART_TOOLS.md 2015-10-27 17:58:33 +00:00
TOOLS_JS.md cleanup(tooling): move tooling to the browser platform and rename profile into instrumentation 2015-11-24 19:29:52 +00:00
TRIAGE_AND_LABELS.md chore(docs): explain the process for merging changes to master 2015-08-11 21:28:46 +00:00
bower.json fix(benchmarks): update react and polymer benchmarks and get tree update numbers for all of the benchmarks as well. 2015-10-28 13:17:01 -07:00
browser-providers.conf.js chore(build): split browsers between providers 2015-12-02 14:21:09 -08:00
gulpfile.js feat(test): add angular2_testing dart library 2015-12-03 11:33:46 -08:00
karma-dart-evalcache.js fix(karma-dart-evalcache): make the code compatible with karma 0.13.x 2015-10-03 21:33:57 +00:00
karma-dart.conf.js build(browserstack): initial setup 2015-11-01 23:22:40 +01:00
karma-js.conf.js refactor(facade): use rxjs package 2015-12-02 16:02:34 -08:00
npm-shrinkwrap.clean.json refactor(facade): use rxjs package 2015-12-02 16:02:34 -08:00
npm-shrinkwrap.json refactor(facade): use rxjs package 2015-12-02 16:02:34 -08:00
npm-shrinkwrap.readme.md chore: reformat npm-shrinkwrap.readme.md for normal line length 2015-08-22 14:20:33 -07:00
package.json refactor(facade): use rxjs package 2015-12-02 16:02:34 -08:00
perf-cloud-secret.template.js refactor(build): support multiple configurable browsers for e2e and perf tests 2015-01-20 13:06:37 -08:00
protractor-dart2js.conf.js chore: rename modules/examples to modules/playground 2015-10-18 11:48:43 +00:00
protractor-js-dev.conf.js chore(test): setup a gulp task for quickly running e2e tests against the dev server 2015-06-11 16:58:32 -07:00
protractor-js-prod.conf.js chore(build): add a task to watch and render examples and e2e tests for production 2015-06-19 18:57:41 -04:00
protractor-js.conf.js Revert "chore(benchmarks): disable broken benchmarks" 2015-08-21 05:59:53 +00:00
protractor-shared.js fix(benchmarks): fix tracing categories to work with Dartium 2015-11-10 15:38:40 -08:00
pubspec.yaml refactor(compiler): make all commands const 2015-11-09 10:59:08 -08:00
test-init.dart refactor(core): move render/dom from core 2015-11-17 15:53:55 -08:00
test-main.dart refactor(test): rename test_lib to testing 2015-10-13 10:36:49 -07:00
test-main.js refactor(facade): use rxjs package 2015-12-02 16:02:34 -08:00
tsconfig.json tools: updated the VS Code config 2015-07-07 08:17:58 -07:00

README.md

Build Status Join the chat at https://gitter.im/angular/angular Issue Stats Issue Stats npm version Downloads Sauce Test Status

Angular

Angular is a development platform for building mobile and desktop web applications. This is the repository for Angular 2, both the JavaScript (JS) and Dart versions.

Angular 2 is currently in Developer Preview. We recommend using Angular 1.X for production applications:

Quickstart

Get started in 5 minutes.

Setup & Install Angular 2

Follow the instructions given on the Angular download page.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.