Commit Graph

2821 Commits

Author SHA1 Message Date
Mikael Morlund ae05ec69c4 Update overview.md
Closes #6478
2016-01-15 17:44:30 +00:00
Tobias Bosch eda4c3eb4c fix(template_compiler): Fix erroneous cycle detection
Before, the check for cycles was wrong and lead to false positives.

Fixes #6404

Closes #6474
2016-01-14 23:08:30 +00:00
Tim Blasi 4d0c2ed1f6 test(dart/transform): Update dependencies & fix Dart tests
Widen version dependencies for `package:angular`, `package:code_transformers`,
and `package:observe`.

`package:guinness` uses `package:unittest` while
the newest versions of `package:code_transformers` use `package:test`.
This causes our end-to-end Dart transformer tests (which use testing
code in `package:code_transformers`) to be skipped.

To fix this:
- Move e2e tests to run in a separate file
- Run `gulp test.server.dart` tests serially

Closes #5922

Closes #5935
2016-01-14 00:29:03 +00:00
Jason Teplitz eda6a5d52a refactor(WebWorker): Rename WORKER_RENDER_APP to WORKER_RENDER_APPLICATION
BREAKING CHANGE

WORKER_RENDER_APP is now deprecated. Use WORKER_RENDER_APPLICATION instead
WORKER_RENDER_APP_COMMON has been replaced by WORKER_RENDER_APPLICATION_COMMON

closes #6184

Closes #6378
2016-01-14 00:07:13 +00:00
Tim Blasi c1c54ed0f2 refactor(dart/transform): Avoid using package:code_transformers
Replace uses of `package:code_transformers`, which is only used to
convert from uri to `AssetId`, with calls to the utility methods in
`src/transform/common/url_resolver.dart`.

Closes #5931
2016-01-13 22:24:42 +00:00
Yegor Jbanov ac85cbb28a fix(web_workers): support @AngularEntrypoint in web workers
And enable transformers on all playground apps

Closes #6013
2016-01-13 17:55:01 +00:00
Julie Ralph b0cebdba6b feat(test): allow tests to specify the platform and application providers used
With providers split into bundles, the test injector is now able to
use providers for a given bundle. Suggested provider lists for tests are
available in `angular2/platform/testing/<platform>`.

Change the providers for a test suite using `setBaseTestProviders`. This
should be done once at the start of the test suite, before any test cases
run.

BREAKING CHANGE: Tests are now required to use `setBaseTestProviders`
to set up. Assuming your tests are run on a browser, setup would change
as follows.

Before:

```js
// Somewhere in test setup
import {BrowserDomAdapter} from 'angular2/src/platform/browser/browser_adapter';
BrowserDomAdapter.makeCurrent
```

After:

```js
// Somewhere in the test setup
import {setBaseTestProviders} from 'angular2/testing';
import {
  TEST_BROWSER_PLATFORM_PROVIDERS,
  TEST_BROWSER_APPLICATION_PROVIDERS
} from 'angular2/platform/testing/browser';

setBaseTestProviders(TEST_BROWSER_PLATFORM_PROVIDERS,
                     TEST_BROWSER_APPLICATION_PROVIDERS);
```

Closes #5351, Closes #5585

Closes #5975
2016-01-13 02:11:06 +00:00
Victor Berchet 933a9112da fix(ChangeDetection): chain expressions evaluate to the last expression (codegen)
fixes #4782
Closes #5892
2016-01-12 17:10:42 +00:00
eric 8c37b7e8f2 fix(directive): throw if output the same event more than once
Close: #4798
2016-01-11 16:48:57 -08:00
Brendan Wyse c8e909f8c9 docs(cheatsheet): fix pipe name in an example
Closes #6399
2016-01-12 00:12:00 +00:00
Hank Duan 69ae3634c7 feat(testability): Expose function frameworkStabilizers
Closes #5485
2016-01-11 23:10:51 +00:00
Filipe Silva b3c7df1783 docs(cheatsheet): fix bootstrap ts namespace
Fix https://github.com/angular/angular.io/issues/615
Closes #6159
2016-01-09 01:01:17 +00:00
Tobias Bosch 7ae23adaff feat(core): speed up view creation via code gen for view factories.
BREAKING CHANGE:
- Platform pipes can only contain types and arrays of types,
  but no bindings any more.
- When using transformers, platform pipes need to be specified explicitly
  in the pubspec.yaml via the new config option
  `platform_pipes`.
- `Compiler.compileInHost` now returns a `HostViewFactoryRef`
- Component view is not yet created when component constructor is called.
  -> use `onInit` lifecycle callback to access the view of a component
- `ViewRef#setLocal` has been moved to new type `EmbeddedViewRef`
- `internalView` is gone, use `EmbeddedViewRef.rootNodes` to access
  the root nodes of an embedded view
- `renderer.setElementProperty`, `..setElementStyle`, `..setElementAttribute` now
  take a native element instead of an ElementRef
- `Renderer` interface now operates on plain native nodes,
  instead of `RenderElementRef`s or `RenderViewRef`s

Closes #5993
2016-01-05 08:56:46 -08:00
vsavkin b44d36cf95 fix(forms): fix SelectControlValueAccessor not to call onChange twice
Closes #5969
2016-01-04 20:33:13 +00:00
Brian Ford a038bb9ae3 fix(router): preserve specificity for redirects
Previously when comparing which of multiple possible routes to choose in
an ambiguous case, we looked at the specificity of the target of redirect
matches rather than the original match. This meant that if a redirect
used a whilecard, but redirected to a target that was a static path,
we'd cound the static path's specificity instead of the wildcard.

This change stores the specificity of the redirect on the RedirectInstruction.

Closes #5933
2016-01-04 20:06:21 +00:00
Hank Duan 9d28147acb fix(benchpress): fix flake
memory was not allocated to be high enough, resulting in partial results to be
clipped, and therefore failing the assertions

Closes #6161
2016-01-04 19:25:32 +00:00
Victor Berchet 9a70f1a1d9 fix(TemplateParser): do not match on attrs that are bindings
Closes #5914
2015-12-24 14:44:16 +00:00
Vladislav Zarakovsky cab69f689f docs(cheatsheet): fix typo in <template> syntax description
Closes #6051
2015-12-23 02:57:47 +00:00
Brian Ford b2bc50dbd1 fix(router): correctly sort route matches with children by specificity
This changes the way we calculate specificity. Instead of using a number,
we use a string, so that combining specificity across parent-child instructions
becomes a matter of concatenating them

Fixes #5848

Closes #6011
2015-12-21 10:38:13 +00:00
Julie Ralph e748adda2e refactor(testing): move common testing logic into test_injector
Before, all test framework wrappers (internal for dart and js/ts,
angular2_test for dart and testing for js/ts) had similar logic to
keep track of current global test injector and test provider list.
This change wraps that logic into one class managed by the test
injector.

Closes #5920
2015-12-18 08:23:29 +00:00
Yegor Jbanov 630d93150a fix(core): IE only supports parentNode
Closes #5994
2015-12-18 01:48:09 +00:00
Yegor Jbanov c47d85b038 fix(code size): revert previous devMode change to restore size targets
This commit reverts a8d9dbf that introduced a code size regression (16kb gzipped, 63kb minified) in Dart.

Effect on the hello world app:

gzipped: 105kb -> 89kb
minified: 370kb -> 317kb

BREAKING CHANGE:
- This is very unlikely to be breaking, but I'm still marking just in case. The only change to the user should be that dev mode is driven by Dart's checked mode, like it was in the past.
2015-12-18 01:06:25 +00:00
vsavkin 197cf09689 feat(core): improve NoAnnotationError message
Closes #4866

Closes #5927
2015-12-17 23:37:54 +00:00
vsavkin e67ebb7f70 feat(core): improve stringify for dart to handle closures 2015-12-17 23:37:54 +00:00
flyyang 9276dad42c docs: fix some typos in comments and strings
Couple of typos fixed:
- occuring -> occurring
- imlement -> implement
- idenitifer -> identifer
etc...

Closes #5943
2015-12-17 22:57:43 +00:00
Brian Ford 2a2f9a9a19 feat(router): support links with just auxiliary routes
Closes #5930
2015-12-16 19:50:19 +00:00
Igor Minar fc75220d63 fix(router): export ROUTER_LINK_DSL_PROVIDER and hide MockPopStateEvent 2015-12-15 09:45:00 -08:00
vsavkin 3dca9d522a feat(core): enable dev mode by default
BREAKING CHANGE

Before

Previously Angular would run in dev prod mode by default, and you could enable the dev mode by calling enableDevMode.

After

Now, Angular runs in the dev mode by default, and you can enable the prod mode by calling enableProdMode.
2015-12-15 08:34:44 -08:00
Pawel Kozlowski 61b9468596 fix(bundles): rename UMD bundles
BREAKING CHANGE:

UMD bundles were renamed:
* `angular2.umd.js` -> `angular2-all.umd.js`
* `angular2-testing.umd.js` -> `angular2-all-testing.umd.js`

Closes #5898
2015-12-15 10:24:32 +00:00
Igor Minar c6f52e3282 docs(cheatsheet): fix the ES5 snippets for services 2015-12-15 01:27:19 -08:00
Igor Minar 29600c0c87 docs(bundles): update RxJS info in bundles/overview.md post-#5893 2015-12-15 01:07:16 -08:00
Igor Minar 5b63b6764f fix(docs,benchmarks): remove invalid </input> closing tags
Closing #5752
2015-12-15 00:45:31 -08:00
Jeremy Wilken 2835265916 docs(cheatsheet) adding JS specific syntax to cheatsheet
Closes #5861
2015-12-14 23:19:12 -08:00
Julie Ralph b803ecf7e7 refactor(testing): reenable injectAsync checking for return value
Before #5375, injectAsync would check the return value and fail
if it was not a promise, to help users remember that they need to
return a promise from an async test. #5375 removed that with the
introduction of the testing zone.

This un-deprecates `injectAsync` until we can resolve
https://github.com/angular/angular/issues/5515.

To be clear, this means that `inject` and `injectAsync` are now
identical except that `injectAsync` will fail if the test
does not return a promise, and `inject` will fail if the test
returns any value.

Closes #5721
2015-12-15 05:51:54 +00:00
Ciro Nunes e891baeea4 chore: remove unused decorator
Closes #5880
2015-12-15 05:20:35 +00:00
Alex Eagle 2aaef81b1b Revert "refactor(testing): move common testing logic into test_injector"
This reverts commit b88a6d983f.
2015-12-14 20:27:31 -08:00
Alex Rickabaugh 3191fd1440 cleanup(linker): Remove vestigial ComponentUrlMapper.
Closes #5849
2015-12-15 03:04:49 +00:00
Alex Rickabaugh 80a5e47e61 docs(*): Document a lot more symbols that are missing comments in our generated docs. 2015-12-15 03:04:48 +00:00
Victor Berchet 5a04ffec3e refactor(Directive): drop moduleId
moduleId is only used by components to resolve urls.
Directives have no templates and do not need moduleId.
Closes #5873
2015-12-15 01:20:56 +00:00
Pawel Kozlowski 1c779d8b9e docs(bundles): document existing bundles and their usage
Closes #5777

Closes #5878
2015-12-15 01:18:44 +00:00
Julie Ralph b88a6d983f refactor(testing): move common testing logic into test_injector
Before, all test framework wrappers (internal for dart and js/ts,
angular2_test for dart and testing for js/ts) had similar logic to
keep track of current global test injector and test provider list.
This change wraps that logic into one class managed by the test
injector.

Closes #5819
2015-12-15 01:14:48 +00:00
Jason Teplitz 006a96dd20 refactor(WebWorker): Make WebWorker bootstrap synchronous
BREAKING CHANGE

From the app thread, in both TypeScript and Dart, you bootstrap the app
using `application` instead of `asyncApplication`.
Before:
```TypeScript
platform([WORKER_APP_PLATFORM])
.asyncApplication(setupWebWorker, optionalProviders?)
.then((ref) => ref.bootstrap(RootComponent));
```
Now:
```TypeScript
platform([WORKER_APP_PLATFORM])
.application([WORKER_APP_APPLICATION])
.bootstrap(RootComponent);
```

closes #5857

Closes #5862
2015-12-14 21:04:46 +00:00
Georgios Kalpakas 1607ef8782 refactor(HtmlLexer): process carriage returns in one pass
Closes #5867
2015-12-14 20:17:06 +00:00
vsavkin 43f42d9c6e feat(facade): do not reexport Observable from angular2/core
BREAKING CHANGE

Before import {Observable} from 'angular2/core'

After import {Observable} from 'rxjs/Observable';
2015-12-12 19:28:13 +00:00
Jeff Cross a885f37dfa fix(web_workers): remove unnecessary setup module and AppRootUrl
Since AppRootUrl is removed, the logic for extending and emitting
the root url as part of the setup seems unnecessary.

BREAKING CHANGES:

The setupWebWorker function exported from 
angular2/platform/worker_app  no longer returns a promise of providers, 
but instead synchronously returns providers.

Related to #5815
Closes #5820
2015-12-12 00:58:56 +00:00
Jeff Cross ed2c25eb2f fix(compiler): remove AppRootUrl
Related to #5815

This should not break anything because AppRootUrl wasn't actually
being used by the compiler anymore.
2015-12-12 00:58:56 +00:00
Tobias Bosch b1b0593ddf docs(core): replace `angular2/angular2` with the right barrel import.
Related to #5710
Closes #5847
2015-12-11 15:30:25 -08:00
Tobias Bosch 200dc00dbb fix(angular2): remove `angular2.ts` module
Closes #5815
Closes #5844

BREAKING CHANGE:

`angular2/angular2` was removed. Use the correct import from one of the barrels. E.g. `angular2/core`, `angular2/platform/browser`,  `angular2/common`, …

Note: This only applies to JavaScript, Dart is not changed.
2015-12-11 14:21:33 -08:00
Pawel Kozlowski 20c6eebb29 fix(angular2): don't export compiler bits as public API
Closes #5815
Closes #5797

BREAKING CHANGE:

The following symbols are not exported from angular2/angular2 any more:
`UrlResolver`, `AppRootUrl`, `getUrlScheme`, `DEFAULT_PACKAGE_URL_PROVIDER`.
Use imports from `angular2/compiler` instead.
2015-12-11 14:04:01 -08:00
vsavkin 44c648fc04 Revert "fix(animate): ensure transition properties are removed once the animation is over"
This reverts commit b8e69a21a9.
2015-12-11 13:13:11 -08:00
Jeff Cross 979162d324 fix(public_spec): check exports of barrels instead of angular2/angular2
This changes the public api spec to check each public barrel individually
to make sure its API has not changed. The previous API spec has been
preserved but split into respective barrels.

The compiler barrel has been added to the spec, along with all of its
public exports. Previously, angular2/angular2 was only exporting a
handful of symbols from compiler, so there are now many more symbols
being tested in the spec for compiler than previously.

Part of #5710
Closes #5841
Supercedes #5821
2015-12-11 13:05:52 -08:00
Yegor Jbanov 2934b82113 chore(tools): remove unused performance import
Closes #5840
2015-12-11 20:32:17 +00:00
Tim Blasi 92ddc62bed fix(styles): Escape \r characters in compiled text
Closes #5772

Closes #5835
2015-12-11 19:48:43 +00:00
gdi2290 0cb32c2fef feat(Headers): implement `toJSON` 2015-12-11 19:40:56 +00:00
Alejandro Caravaca Puchades 2ca5e38a78 fix(upgrade): allow directives with empty template 2015-12-11 11:39:45 -08:00
Matias Niemelä b8e69a21a9 fix(animate): ensure transition properties are removed once the animation is over 2015-12-11 11:38:24 -08:00
Kathy Walrath 3fd898e91f docs(cheatsheet): copyedit
Fixed a few little things. I'll probably have more changes to make later, once I understand everything better.

Also added a missing syntax line.

Closes #5806
2015-12-11 18:41:57 +00:00
Pawel Kozlowski a66cc50168 refactor(testing): limit imports of barrel-private APIs
Closes #5603
2015-12-11 18:39:56 +00:00
Pawel Kozlowski eb296756fb refactor(benchmarks): remove imports from 'angular2/angular2'
Closes #5799
2015-12-11 18:33:03 +00:00
Pawel Kozlowski f1a9a537cb test(core): remove imports from 'angular2/angular2'
Closes #5829
2015-12-11 18:02:23 +00:00
Victor Berchet 080469f8e6 fix(HtmlParser): allow ng-content elements regardless the namespace
relates to #5547
Closes #5745
2015-12-11 01:36:48 +00:00
Victor Berchet 7c13372721 fix(TemplateParser): match element and attributes regardless the namespace 2015-12-11 01:36:48 +00:00
Alex Rickabaugh 778677ba75 docs(core): Myriad of documentation changes including lots of new example code. 2015-12-10 15:23:57 -08:00
Cody Lundquist e9e2a4152e docs: fix variable name, change to camelCase
closes #5801
2015-12-10 14:35:28 -08:00
Rob Wormald 398f024b24 fix(async): support BehaviorSubjects in async pipe 2015-12-10 21:49:40 +00:00
Rob Wormald 4a17e6906c fix(async): improve Rx support in ObservableWrapper 2015-12-10 21:49:40 +00:00
Pawel Kozlowski 8d3e5596dc refactor(playground): remove imports from 'angular2/angular2'
Part of #5710

Closes #5798
2015-12-10 21:46:51 +00:00
Pawel Kozlowski df6d2d1e23 refactor(examples): remove imports from 'angular2/angular2'
Closes #5803
2015-12-10 21:45:58 +00:00
Pawel Kozlowski d26c338aa0 refactor(material): remove imports from 'angular2/angular2'
Closes #5800
2015-12-10 21:19:38 +00:00
Tobias Bosch edcb34dc9f fix(dom_renderer): moveNodeAfterSiblings should not detach the reference node
Fixes #5077
Closes #5759
2015-12-10 20:14:27 +00:00
Jeff Cross 693d9dce5d fix(parse5): support comment nodes with getText and setText
In the browser, calling element.textContent causes child comment
nodes to be ignored, while getting textContent directly on a
comment node will return the comment. This change makes
parse5Adapter consistent with this behavior by adding a 2nd
argument to getText telling if it's being called recursively.

Closes #5805
2015-12-10 19:18:14 +00:00
Jeff Cross 194dc7da78 feat(renderer): use a comment instead of an element when stamping out template>` elements
Originally authored by @tbosch, this reverts the revert commit
e274ff8a69.

Closes #4805
2015-12-10 19:18:14 +00:00
Jeff Cross 79399e1c51 feat(dom_renderer): add setBindingDebugInfo method
This is used for setting property binding values as attributes
on elements when running in dev mode. This implementation will
also serialize binding information to template placeholder
comment nodes.

Closes #5227
2015-12-10 19:18:14 +00:00
Olivier Chafik fe1dd77d94 feat(benchpress): add receivedData + requestCount to PerflogMetric
Closes #5750
2015-12-10 18:51:47 +00:00
Igor Minar cf3ce171a5 docs(kebab-case.md): more fixes and CSS migration instructions
Closes #5773
2015-12-10 04:18:17 -08:00
Jesús Rodríguez Rodríguez 06d076a6f2 docs(kebab-case): fix typo on property
Closes #5783
2015-12-10 03:42:43 -08:00
Daniel 3190c5941a fix(changelog): fix ngFor on template
Closes #5785
2015-12-10 03:41:00 -08:00
Igor Minar 30e25acb9f fix(core): workaround for typescript@1.7.3 breakage #5784
I don't understand why I need to declare the type-here, but it resolves the issue.

Looks like a bug in tsc.

Fixes #5784
2015-12-10 03:30:16 -08:00
Igor Minar b3d10af89a docs(kebab-case.md): fix indentation, add links and other small changes 2015-12-10 00:48:32 -08:00
Igor Minar 4724cc664e docs(kebab-case.md): add link to the design doc 2015-12-10 00:18:08 -08:00
Victor Berchet 9e44dd85ad feat(camelCase Angular): legacy template transformer 2015-12-09 19:59:40 -08:00
Victor Berchet da9b46a071 feat: camelCase Angular (kebab-case removal)
BREAKING CHANGE:

Angular is now fully camel case.

Before:

    <p *ng-if="cond">
    <my-cmp [my-prop]="exp">
    <my-cmp (my-event)="action()">
    <my-cmp [(my-prop)]="prop">
    <input #my-input>
    <template ng-for #my-item [ng-for-of]=items #my-index="index">

After

    <p *ngIf="cond">
    <my-cmp [myProp]="exp">
    <my-cmp (myEvent)="action()">
    <my-cmp [(myProp)]="prop">
    <input #myInput>`,
    <template ngFor="#my-item" [ngForOf]=items #myIndex="index">

The full details are found in [angular2/docs/migration/kebab-case.md](https://github.com/angular/angular/blob/master/modules/angular2/docs/migration/kebab-case.md)
2015-12-09 19:59:40 -08:00
Victor Berchet b386d1134a doc(camelCase Angular): migration guide 2015-12-09 19:59:40 -08:00
Igor Minar 51cb7586e0 build(npm): update to typescript@1.7.3 + fix broccoli-typescript + fix src 2015-12-10 01:32:44 +00:00
Matias Niemelä 28860d35b2 feat(core): provide support for relative assets for components
Assets defined for `templateUrl` and `styleUrls` can now be loaded
in relative to where the component file is placed so long as the
`moduleId` is set within the component annotation.

Closes #5634
2015-12-09 16:28:49 -08:00
Matias Niemelä 5f0ce30ee6 revert: feat(core): provide support for relative assets for components 2015-12-09 16:26:42 -08:00
Kathy Walrath f4d937ad8d docs(cheatsheet): add Dart-specific syntax & headings
Closes #5756
2015-12-09 23:05:23 +00:00
Matias Niemelä db096a5e22 feat(core): provide support for relative assets for components
Assets defined for `templateUrl` and `styleUrls` can now be loaded
in relative to where the component file is placed so long as the
`moduleId` is set within the component annotation.

Closes #5634

Closes #5634
2015-12-09 22:04:00 +00:00
Pawel Kozlowski 793098bcce refactor(upgrade): remove imports from angular2/angular2
Related #5739
2015-12-09 21:04:41 +00:00
Jeff Cross 61e8b60506 docs(Observable): add documentation for Observable and operators
Closes #5642
Closes #5684
2015-12-09 19:32:30 +00:00
Peter Bacon Darwin 2f0744b089 docs(cheatsheet): update to new syntax
See https://github.com/angular/angular.io/pull/459

Closes #5733
2015-12-09 19:04:08 +00:00
Peter Bacon Darwin ca73852746 docs(AngularEntrypoint): add missing backticks 2015-12-09 19:04:08 +00:00
Michael Mrowetz 72444c40a7 typo fix: registerPrimaryOutlet description
Closes #5648
2015-12-08 19:55:35 -08:00
Rob Wormald cbf788869d fix(http): use `any` for res.json() return
fixes #5636

Closes #5646
2015-12-09 03:00:22 +00:00
Marc Laval c1ae49d91e fix(testing): remove Symbol dummy shim
Closes #5067

Closes #5719
2015-12-09 02:57:19 +00:00
Rob Wormald 869a392357 fix(package) add missing comma in ngHttp package.json
Closes #5727
2015-12-08 18:51:19 -08:00
Pawel Kozlowski a4ba46cb99 fix(bundles): remove SFX bundle
Closes #5665

BREAKING CHANGE:

The existing sfx bundle (angular2.sfx.dev.js) is replaced by UMD bundles:
angular2.umd.js and angular2.umd.dev.js. The new UMD bundles dont have
polyfills (zone.js, reflect-metadata) pre-appended. Those polyfills
can be easily loaded by including the angular-polyfills.js bundle.

Closes #5712
2015-12-08 16:09:52 -08:00
vsavkin 0df8bc4e52 fix(dynamic_component_loader): leave the view tree in a consistent state when hydration fails
Closes #5718
2015-12-08 16:09:38 -08:00
vsavkin 0d9a1de4d9 fix(bootstrap): fix the configuration of ExceptionHandler 2015-12-08 16:09:37 -08:00
vsavkin d58f017226 cleanup(pipes): improve the error message of InvalidPipeArgumentException 2015-12-08 16:09:37 -08:00
Brian Ford aa85856e1c fix(router): set correct redirect/default URL from hashchange
Currently, hashchange events outside of Angular that cause navigation
do not take into account cases where the initial route URL changes
due to a redirect or a default route.

Closes #5590

Closes #5683
2015-12-08 22:34:19 +00:00
Victor Berchet 8657ca4298 fix(form): Form directives are exportedAs 'ngForm' (was 'form')
fixes #5658

BREAKING CHANGE:

Before:

    <form #f="form">

After:

    <form #f="ngForm">

Closes #5709
2015-12-08 20:25:16 +00:00
Igor Minar 80b025ae53 build(broccoli): convert dependencies to peerDependencies in all package.json templates
This is more correct and resolves the issue of having dupes within the same project.

This change has no impact on our shrinkwrap since peerDeps and deps are merged into one
within the shrinkwrap file.

BREAKING CHANGE: rxjs, reflect-metadata, zone.js and es6-shims now must be specified as
explicit dependencies of each angular app that uses npm for package management.

To migrate, please add the following into the "dependencies" section of your package.json:

```
"dependencies": {
    ...

    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-alpha.11",
    "zone.js": "0.5.8"

    ...
}
```

Closes #5560

Closes #5649
2015-12-08 11:52:26 -08:00
Jeff Cross c39f4c3b38 refactor(Observable): implement toPromise and fromPromise without side effects
BREAKING CHANGE:

toPromise is no longer an instance method of the `Observable` returned
by Angular, and fromPromise is no longer available as a static method.

The easiest way to account for this change in applications is to import
the auto-patching modules from rxjs, which will automatically add these
operators back to the Observable prototype.

```
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/observable/fromPromise';
```

Closes #5542
Closes #5626
2015-12-08 18:31:02 +00:00
Victor Berchet 1f35048d54 feat(TemplateParser): allow template elements regardless the namespace
Closes #5703
2015-12-08 17:46:14 +00:00
Victor Berchet eb0ea931d0 fix(HtmlParser): ignore LF immediately following pre, textarea & listing
fixes #5630

Closes #5688
2015-12-08 02:39:17 +00:00
Victor Berchet 47f1d12731 fix(HtmlLexer): tag name must follow "<" without space
see http://www.w3.org/TR/html5/syntax.html#tag-open-state
2015-12-08 02:39:17 +00:00
Victor Berchet aecf68117a feat(HtmlLexer): allow "<" in text tokens
fixes #5550
2015-12-08 02:39:17 +00:00
Victor Berchet 3a438615c3 fix(HtmlParser): Do not add parent element for template children
fixes #5638
2015-12-08 02:39:17 +00:00
Victor Berchet 9850e68703 fix(HtmlLexer): handle CR in input stream per HTML spec
fixes #5618
Closes #5629
2015-12-08 02:18:20 +00:00
Tero Parviainen daaa8ee1cd fix(compiler): support properties on SVG elements
Have DomElementSchemaRegistry support namespaced elements,
so that it does not fail when directives are applied in SVG (or xlink).
Without this fix, directives or property bindings cannot be
used in SVG.

Related to #5547

Closes #5653
2015-12-08 02:18:07 +00:00
Pawel Kozlowski 50490b55eb fix(HtmlParser): mark <source> elements as void
Fixes #5663

Closes #5668
2015-12-08 02:15:15 +00:00
Brandon Roberts 7f0925eb2b docs(router): Updated documentation for router generate method
Closes #5399
2015-12-08 01:44:53 +00:00
Julie Ralph 85d89babce fix(build): lock down version of package:code_transformers
A new verion is causing build issues, perhaps due to an undeclared
dependency on package:test. For now, lock down the version to the
last known working one.
2015-12-07 17:42:24 -08:00
Yegor Jbanov 2d313c4d1d chore(parser): add tests for conditional expressions
Closes #5647
2015-12-07 15:16:57 -08:00
cexbrayat e6170e8ac3 docs(http): fix MockBackend imports
Fixes #5639

Closes #5651
2015-12-07 15:16:18 -08:00
Pascal Precht c6d6b75691 refactor(test/linker): fix typo in directive name 2015-12-04 19:32:51 -08:00
Pascal Precht f664a9c4d5 refactor(test/linker): remove unused directive in tests 2015-12-04 19:32:51 -08:00
Victor Berchet d388c0ae62 feat(HtmlParser): enforce only void & foreign elts can be self closed
BREAKING CHANGE:

`<whatever />` used to be expanded to `<whatever></whatever>`.
The parser now follows the HTML5 spec more closely.
Only void and foreign elements can be self closed.

Closes #5591
2015-12-04 20:05:27 +00:00
Victor Berchet 56604468e0 feat(HtmlParser): enforce no end tag for void elements
BREAKING CHANGE

End tags used to be tolerated for void elements with no content.
They are no more allowed so that we more closely follow the HTML5 spec.
2015-12-04 20:05:27 +00:00
cexbrayat b925ff5b8d refactor(http): rename enums to be singular
ReadyStates -> ReadyState
RequestMethods -> RequestMethod
ResponseTypes -> ResponseType

Fixes #5574

BREAKING CHANGE:

Before

import {ReadyStates, RequestMethods, ResponseTypes} from 'angular2/http';

After

import {ReadyState, RequestMethod, ResponseType} from 'angular2/http';

Closes #5584
2015-12-04 19:16:00 +00:00
Thomas Henley c6a5d9bc84 refactor(validators) rename maxLength validator parameter
Closes #5592
2015-12-04 18:49:02 +00:00
Jason Teplitz 5e50859a03 fix(WebWorker): Add @AngularEntrypoint to worker_app bundle
Closes #5588
2015-12-04 01:26:20 +00:00
vsavkin 4ea5b6e57f feat(router): implement router link DSL
Closes #5557

Closes #5562
2015-12-04 00:47:20 +00:00
Victor Berchet e67e1952d0 fix(HtmlParser): ng-content is not a void element
fixes #5563
Closes #5586
2015-12-03 23:42:46 +00:00
Tobias Bosch 0614797d84 refactor(test_injector): Provide separate methods for creating test injector with and without runtime compiler.
BREAKING CHANGE:
`createTestInjector()` does not more include the runtime compiler. Use `createTestInjectorWithRuntimeCompiler()` instead.
Closes #5583
2015-12-03 22:50:14 +00:00
Tim Blasi 0a3a17ff10 fix(dart/reflection): Fix `NoReflectionCapabilities` interface
Make `NoReflectionCapabilities` conform to the `PlatformReflectionCapbilities`
api, which prevents some confusing error messages.

Closes #5559

Closes #5578
2015-12-03 22:11:26 +00:00
erictsangx 680f7e0299 fix(core/forms): input[type=text] .valueChanges fires unexpectedly
Closes #4768, #5284

Closes #5401
2015-12-03 22:11:16 +00:00
Brandon Roberts 478a25ed27 refactor(angular_1_router): Added value for router root component
Closes #4965

Closes #5052
2015-12-03 22:05:51 +00:00
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
Julie Ralph 93a1ec29e1 feat(test): add angular2_testing dart library
angular2_testing is a user-facing dart test library built on top of
the package:test dart unittest framework and runner. For usage,
see modules_dart/angular2_testing/README.md.

Closes #3289
2015-12-03 11:33:46 -08:00
Victor Berchet d90a2269f9 feat(HtmlParser): add most common named character references
fixes #5546
Closes #5579
2015-12-03 19:28:50 +00:00
Foxandxss 69996b1740 test(http): remove stale SpyObserver
Closes #5134
2015-12-03 10:54:42 -08:00
Tim Blasi 35e32bbea1 feat(mocks): Mark mock objects @Injectable()
Make mock objects `@Injectable()` to allow using them in compiled tests.

Closes #5576
2015-12-03 10:49:56 -08:00
Julie Ralph e9f873a365 feat(testing): export useful properties from componentFixture
The component fixture returned from the test component builder
now exports `nativeElement` and `componentInstance` members
directly. They are also still available on the `debugElement`.

See #5385
2015-12-02 16:05:01 -08:00
Jeff Cross 25a2d7b5db chore(async): clean up unused promise imports 2015-12-02 16:02:34 -08:00
Rob Wormald c635a73ed9 refactor(http): remove mockbackend export from angular2/http barrel 2015-12-02 16:02:34 -08:00
Jeff Cross f76eea4f9b chore(http): update http example to include map operator 2015-12-02 16:02:34 -08:00
Rob Wormald 5514dc19d9 refactor(facade): use rxjs package
move to new RxJS distribution.

BREAKING CHANGE:

RxJS imports now are via `rxjs` instead of `@reactivex/rxjs`
Individual operators can be imported `import 'rxjs/operators/map'`
2015-12-02 16:02:34 -08:00
Rob Wormald a16ac84840 refactor(async): use ultralight Observable
Closes #5283
2015-12-02 16:02:34 -08:00
Julie Ralph ad99199d50 chore(test): remove deprecated RootTestComponent
Uses of `RootTestComponent` should be migrated to `ComponentFixture`.
2015-12-02 15:00:55 -08:00
Gion Kunz c7242a39d2 style(playground): use single quotes consistently 2015-12-02 14:59:55 -08:00
mlaval 4fa1809f80 chore(build): make the unit tests campaign to run again in Edge 2015-12-02 14:34:31 -08:00
mlaval fb16c39496 chore(build): fix flakiness of the element probe global test 2015-12-02 14:19:07 -08:00
Victor Berchet 62c2ed7c43 feat(HtmlParser): better error message when a void tag has content 2015-12-02 14:17:41 -08:00
Victor Berchet 9c6b929c7b fix(HtmlParser): close void elements on all node types
fixes #5528
2015-12-02 14:17:41 -08:00
Jesper Rønn-Jensen 070d818e68 refactor(tests): rename beforeEachBindings -> beforeEachProviders
Change beforeEachBindings to beforeEachProviders but preserve the
@deprecated method beforeEachBindings, in order to keep a working
deprecation warning
2015-12-02 14:09:13 -08:00
mgechev 1417e12f28 refactor(playground): rename bindings to providers 2015-12-02 13:02:53 -08:00
vsavkin 9a65ea7ea7 feat(core): remove typings from package.json to disallow 'import * as n from 'angular2'''
The typings property is being removed because angular2.ts is deprecated, and the developers should import from angular2/core and angular2/platform/*.  So aliasing angular2 to angular2/angular2 does not make sense.

BREAKING CHANGE

Before

import * as ng from 'angular2';

After

import * as core from 'angular2/core';
2015-12-02 11:48:14 -08:00
Victor Berchet c58e7e0e91 fix(HtmlParser): do not add a tbody parent for tr inside thead & tfoot
fixes #5403
2015-12-02 11:43:51 -08:00
Tim Ruffles bdfed9d850 docs(core): make naming concrete
I think people new to promises, angular etc will find this example easier to understand with concrete identifiers from a simple use-case. The existing naming could be confused with promise/angular functionality (`promise` in the template, `resolved` etc).

Also I made `resolve` private, as then it's clear what we're exposing for the template.
2015-12-02 11:41:52 -08:00
Pascal Precht b9b14dc731 docs: fix typo event1 -> event 2015-12-02 11:40:20 -08:00
Wassim Chegham cf3ceba2cc docs(api): remove extra `the` 2015-12-02 11:38:24 -08:00
Julie Ralph c08d76c7f8 chore(test): remove deprecated angular2/test and angular2/test_lib
These have been deprecated for a while. Instead of angular2/test, use
angular2/testing. Instead of angular2/test_lib, use angular2_testing_internal.
2015-12-02 11:37:29 -08:00
vsavkin 442d6866da test: add a test verifying that the tests are run in the checked mode 2015-12-02 11:29:11 -08:00
Tim Blasi 6b2ef25c69 feat(dart/transform): Introduce @AngularEntrypoint() 2015-12-01 13:34:29 -08:00
Pawel Kozlowski 3e364b0d41 test(schema): fix test names 2015-12-01 13:33:06 -08:00
Pascal Precht c4c4d045fb chore(playground/routing): remove unused bind import
Closes #5305
2015-12-01 18:23:54 +00:00
Jeff Cross fcc7ce225e refactor(pipes): use angular lifecycle hooks instead of PipeOnDestroy
BREAKING CHANGE:
Previously, pipes that wanted to be notified when they were destroyed
would implement the PipeOnDestroy interface and name the callback
`onDestroy`. This change removes the PipeOnDestroy interface and
instead uses Angular's lifecycle interface `OnDestroy`, with the
`ngOnDestroy` method.

Before:
```
import {Pipe, PipeOnDestroy} from 'angular2/angular2';
@Pipe({pure: false})
export class MyPipe implements PipeOnDestroy {
  onDestroy() {}
}
```

After:
import {Pipe, OnDestroy} from 'angular2/angular2';
@Pipe({pure: false})
export class MyPipe implements PipeOnDestroy {
  ngOnDestroy() {}
}
2015-11-30 16:40:50 -08:00
Jeff Cross 604c8bbad5 refactor(lifecycle): prefix lifecycle methods with "ng"
BREAKING CHANGE:
Previously, components that would implement lifecycle interfaces would include methods
like "onChanges" or "afterViewInit." Given that components were at risk of using such
names without realizing that Angular would call the methods at different points of
the component lifecycle. This change adds an "ng" prefix to all lifecycle hook methods,
far reducing the risk of an accidental name collision.

To fix, just rename these methods:
 * onInit
 * onDestroy
 * doCheck
 * onChanges
 * afterContentInit
 * afterContentChecked
 * afterViewInit
 * afterViewChecked
 * _Router Hooks_
 * onActivate
 * onReuse
 * onDeactivate
 * canReuse
 * canDeactivate

To:
 * ngOnInit,
 * ngOnDestroy,
 * ngDoCheck,
 * ngOnChanges,
 * ngAfterContentInit,
 * ngAfterContentChecked,
 * ngAfterViewInit,
 * ngAfterViewChecked
 * _Router Hooks_
 * routerOnActivate
 * routerOnReuse
 * routerOnDeactivate
 * routerCanReuse
 * routerCanDeactivate

The names of lifecycle interfaces and enums have not changed, though interfaces
have been updated to reflect the new method names.

Closes #5036
2015-11-30 16:40:50 -08:00
Brian Ford 4215afc639 fix(router): fix a typing issue
Closes #5518
2015-12-01 00:09:40 +00:00
vsavkin 909031e688 refactor(tests): move facades tests out of tests/core
Closes #5472
2015-11-30 22:24:35 +00:00
vsavkin b7b3c85033 refactor(core): move EventManager from core to platform/dom
Closes #5465
2015-11-30 22:24:35 +00:00
Julie Ralph 0c9596ae2b feat(testing): use zones to avoid the need for injectAsync
Use a zone counting timeouts and microtasks to determine when a test
is finished, instead of requiring the test writer to use
injectAsync and return a promise.

See #5322
2015-11-30 14:06:06 -08:00
vsavkin 87ddc8fb6a fix(compiler): dedup directives in template compiler
Closes #5311

Closes #5464
2015-11-30 19:37:54 +00:00
Brian Ford 6ddfff5cd5 refactor(router): improve recognition and generation pipeline
This is a big change. @matsko also deserves much of the credit for the implementation.

Previously, `ComponentInstruction`s held all the state for async components.
Now, we introduce several subclasses for `Instruction` to describe each type of navigation.

BREAKING CHANGE:

Redirects now use the Link DSL syntax. Before:

```
@RouteConfig([
	{ path: '/foo', redirectTo: '/bar' },
	{ path: '/bar', component: BarCmp }
])
```

After:

```
@RouteConfig([
	{ path: '/foo', redirectTo: ['Bar'] },
	{ path: '/bar', component: BarCmp, name: 'Bar' }
])
```

BREAKING CHANGE:

This also introduces `useAsDefault` in the RouteConfig, which makes cases like lazy-loading
and encapsulating large routes with sub-routes easier.

Previously, you could use `redirectTo` like this to expand a URL like `/tab` to `/tab/posts`:

@RouteConfig([
	{ path: '/tab', redirectTo: '/tab/users' }
	{ path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

Now the recommended way to handle this is case is to use `useAsDefault` like so:

```
@RouteConfig([
	{ path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

@RouteConfig([
	{ path: '/posts', component: PostsCmp, useAsDefault: true, name: 'Posts' },
	{ path: '/users', component: UsersCmp, name: 'Users' }
])
TabsCmp { ... }
```

In the above example, you can write just `['/Tab']` and the route `Users` is automatically selected as a child route.

Closes #4728
Closes #4228
Closes #4170
Closes #4490
Closes #4694
Closes #5200

Closes #5475
2015-11-30 17:06:03 +00:00
Brian Ford a3253210b7 Revert "Revert "test(router): remove View decorator in router link fixtures""
This reverts commit a3353a5e28.
2015-11-30 17:06:03 +00:00
Brian Ford 0dbd0b340c Revert "Revert "feat(router): allow linking to auxiliary routes""
This reverts commit cee67e6fe0.
2015-11-30 17:06:03 +00:00
Pawel Kozlowski 8c670822ce chore(bundles): don't distribute sfx bundles for http
Currently the main sfx bundle already contains http and router
and the http sfx bundles duplicates all core.

Additionally https://github.com/angular/angular/issues/5223
modifies our strategy for individual bundles

Closes #5434
2015-11-30 16:29:58 +00:00
Yegor Jbanov b90de66535 fix(parser): do not crash on untokenizable quote prefixes
Closes #5486
2015-11-25 23:43:52 +00:00
Brian Ford 1bec4f6c61 feat(router): add support for APP_BASE_HREF to HashLocationStrategy
Closes #4935
Closes #5368

Closes #5451
2015-11-25 22:29:43 +00:00
Yegor Jbanov b6ec2387b3 feat(templates): introduce quoted expressions to support 3rd-party expression languages
A quoted expression is:

quoted expression = prefix `:` uninterpretedExpression
prefix = identifier
uninterpretedExpression = arbitrary string

Example: "route:/some/route"

Quoted expressions are parsed into a new AST node type Quote. The `prefix` part of the
node must be a legal identifier. The `uninterpretedExpression` part of the node is an
arbitrary string that Angular does not interpret.

This feature is meant to be used together with template AST transformers introduced in
a43ed79ee7. The
transformer would interpret the quoted expression and convert it into a standard AST no
longer containing quoted expressions. Angular will continue compiling the resulting AST
normally.
2015-11-25 14:28:11 -08:00
mlaval cf157b99d3 chore(test): fix public API test in some browsers
Fixes #5470

Closes #5478
2015-11-25 21:44:26 +00:00
Yegor Jbanov d59c20c315 fix(web worker): remove usages of deprecated zone API
Closes #5425
2015-11-25 19:25:08 +00:00
Nathan Walker 019cb41dd8 fix(EventEmitter): resolve onError and onComplete asynchronously
closes #4443
2015-11-24 16:54:13 -08:00
Yegor Jbanov b4de41b74e chore(parser): cleanup unused imports
Closes #5424
2015-11-24 19:36:30 +00:00
vsavkin 87d56acdaa fix(build): fix source maps
Closes #5444
2015-11-24 19:33:27 +00:00
vsavkin 8daa9b202d cleanup(testing): create top level files for mocks
Closes #5381
2015-11-24 19:29:52 +00:00
vsavkin 89eefcd7b5 cleanup(tooling): move tooling to the browser platform and rename profile into instrumentation
BREAKING CHANGE

Before

import * as p from 'angular2/profile';
import * as t from 'angular2/tools';

After

import * as p from 'angular2/instrumentation';
import * as t from 'angular2/platform/browser';
2015-11-24 19:29:52 +00:00
Alex Rickabaugh cee67e6fe0 Revert "feat(router): allow linking to auxiliary routes"
This reverts commit 0b1ff2db9e.
2015-11-23 16:34:40 -08:00
Alex Rickabaugh a3353a5e28 Revert "test(router): remove View decorator in router link fixtures"
This reverts commit 422a7b18f6.
2015-11-23 16:34:06 -08:00
Alex Rickabaugh c5294c77d9 Revert "refactor(router): improve recognition and generation pipeline"
This reverts commit cf7292fcb1.

This commit triggered an existing race condition in Google code. More work is needed on the Router to fix this condition before this refactor can land.
2015-11-23 16:26:47 -08:00
vsavkin ba64b5ea5a fix(forms): scope value accessors, validators, and async validators to self
Closes #5440
2015-11-23 23:48:54 +00:00
Matias Niemelä 564642d859 chore(core): rename `classname` to `className`
Closes #5371
2015-11-23 22:43:01 +00:00
Matias Niemelä 87549c77d4 chore(core): proper camelcasing for `styleName` and `styleValue` 2015-11-23 22:43:01 +00:00
Matias Niemelä fad354904d test(matchers): add support for `toHaveCssStyle` matcher 2015-11-23 22:43:01 +00:00
Rob Wormald e1d7bdcfe7 fix(http): Fix all requests defaulting to Get
Honor method parameter passed to http.request().

Closes #5309

Closes #5397
2015-11-23 22:17:13 +00:00
Rob Wormald 46fc153f39 fix(http): return URL in Response
Attach reponseURL or X-Request-URL to Response.

Closes  #5165
2015-11-23 22:17:13 +00:00
Rob Wormald 4332ccf72c fix(http): return Response headers
Properly parse and add response Headers to Response.

Closes #5237
2015-11-23 22:17:13 +00:00
Rob Wormald 201f189d0e fix(http): error on non-200 status codes
BREAKING CHANGE:

previously http would only error on network errors to match the fetch
specification. Now status codes less than 200 and greater than 299 will
cause Http's Observable to error.

Closes #5130.
2015-11-23 22:17:13 +00:00
Tim Ruffles 9ca8a35553 docs(core): @View annotations are no longer mandatory
@View is [now optional](angular@bd31b01).

Closes #5413
2015-11-23 19:55:43 +00:00
mlaval 5806babb0b chore(build): increase timeout of the 5 most flaky tests
Closes #5410
2015-11-23 19:23:25 +00:00
vsavkin 30d35b5046 fix(build): do not reexport compiler from angular2/angular2
Closes #5422
2015-11-23 18:57:15 +00:00
Brian Ford cf7292fcb1 refactor(router): improve recognition and generation pipeline
This is a big change. @matsko also deserves much of the credit for the implementation.

Previously, `ComponentInstruction`s held all the state for async components.
Now, we introduce several subclasses for `Instruction` to describe each type of navigation.

BREAKING CHANGE:

Redirects now use the Link DSL syntax. Before:

```
@RouteConfig([
  { path: '/foo', redirectTo: '/bar' },
  { path: '/bar', component: BarCmp }
])
```

After:

```
@RouteConfig([
  { path: '/foo', redirectTo: ['Bar'] },
  { path: '/bar', component: BarCmp, name: 'Bar' }
])
```

BREAKING CHANGE:

This also introduces `useAsDefault` in the RouteConfig, which makes cases like lazy-loading
and encapsulating large routes with sub-routes easier.

Previously, you could use `redirectTo` like this to expand a URL like `/tab` to `/tab/posts`:

@RouteConfig([
  { path: '/tab', redirectTo: '/tab/users' }
  { path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

Now the recommended way to handle this is case is to use `useAsDefault` like so:

```
@RouteConfig([
  { path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

@RouteConfig([
  { path: '/posts', component: PostsCmp, useAsDefault: true, name: 'Posts' },
  { path: '/users', component: UsersCmp, name: 'Users' }
])
TabsCmp { ... }
```

In the above example, you can write just `['/Tab']` and the route `Users` is automatically selected as a child route.

Closes #4170
Closes #4490
Closes #4694
Closes #5200

Closes #5352
2015-11-20 23:18:43 +00:00
Brian Ford 422a7b18f6 test(router): remove View decorator in router link fixtures 2015-11-20 23:18:43 +00:00
Brian Ford 0b1ff2db9e feat(router): allow linking to auxiliary routes
Closes #4694
2015-11-20 23:18:43 +00:00
Yegor Jbanov a43ed79ee7 feat(parser): allows users install custom AST transformers
Closes #5382
2015-11-20 19:46:02 +00:00
vsavkin 125fa3885e cleanup: removes the render and lifecycle_hooks modules
BREAKING CHANGE

Before

import {Renderer} from 'angular2/render';

After

import {Renderer} form 'angular2/core';

Closes #5367
2015-11-20 19:16:38 +00:00
Olivier Combe ae58934d52 docs(async): adding type to EventEmitter now that it is generic
Closes #5391
2015-11-20 00:20:12 +00:00
vsavkin 3c8fa8c50d cleanup: move DomAdapter from angular2/core into angular2/platform/common_dom
BREAKING CHANGE

Before

import {DomAdapter} from 'angular2/core';

After

import {DomAdapter} from 'angular2/platform/common_dom';

Closes #5370
2015-11-20 00:14:24 +00:00
Marc Laval 4d59985b74 chore(build): use Chrome by default for all JS tests
Fixes #5380

Closes #5387
2015-11-19 23:27:42 +00:00
vsavkin 5ba9ced1ab cleanup(core): stop reexporting angular2/common from angular2/core
All common directives, forms, and pipes have been moved out of angular2/core,
but we kept reexporting them to make transition easier.

This commit removes the reexports.

BREAKING CHANGE

Before

import {NgIf} from 'angular2/core';

After

import {NgIf} from 'angular2/common';

Closes #5362
2015-11-19 19:54:27 +00:00
Victor Berchet 36a423fac8 feat(Compiler): case sensitive html parser
close #4417
Closes #5264
2015-11-19 18:55:04 +00:00
Tobias Bosch adb87562bb feat(Compiler): case sensitive html parser 2015-11-19 18:55:04 +00:00
vsavkin 3c43a8c549 feat(bootstrap): add platform and app initializers
Often some init logic needs to run when a platform or an application is boostrapped.
For example, boostraping a platform requires initializing the dom adapter.
Now, it can be done as follows:

new Provider(PLATFORM_INITIALIZER, {useValue: initDomAdapter, multi: true}),

All platform initializers will be run after the platform injector has been created.

Similarly, all application initializers will be run after the app injector has been
created.

Closes #5355
2015-11-18 22:22:32 +00:00
Rob Wormald 3fa287aae2 refactor(EventEmitter): rename .next() to .emit()
BREAKING CHANGE:

EventEmitter#next(value) is deprecated, use EventEmitter#emit(value)
instead.

Closes #4287

Closes #5302
2015-11-18 22:16:40 +00:00
Jeremy Elbourn 929abb9aa3 chore(router): add tests for interaction between router-outer and
@ViewChild.

Closes #5164
2015-11-18 21:23:08 +00:00
vsavkin 2c8fcec432 refactor(core): move render/dom from core
Currently, core depends on DomRenderer, which depends on the browser.
This means that if you depend on angular2/core, you will always
pull in the browser dom adapter and the browser render, regardless
if you need them or not.

This PR moves the browser dom adapter and the browser renderer out of core.

BREAKING CHANGE

If you import browser adapter or dom renderer directly (not via angular2/core),
you will have to change the import path.
2015-11-17 15:53:55 -08:00
Naomi Black d013fc7604 docs(cleanup): fix bad h3 markup and normalize headings
Closes #5341
2015-11-17 22:10:20 +00:00
Brian Ford ac38812809 fix(router): apply APP_BASE_HREF when using PathLocationStrategy
Correctly initializes APP_BASE_HREF, and falls back to the `<base>` tag in the absence
of an APP_BASE_HREF provider.

Closes #5028
2015-11-17 21:19:22 +00:00
Igor Minar bcd926adc5 fix(http): refactor 'require' statements to 'import' declarations for Rx
Looks like this is some old leftover code from the times when Rx didn't distribute typings via npm.

Closes #5287
2015-11-17 01:26:54 +00:00
Alex Rickabaugh b22eddf1cb fix(core): Run component disposal before destroyRootHostView() to avoid crash if change detection is triggered.
Closes #5226
2015-11-17 00:58:13 +00:00
Victor Berchet 857bef9e4f doc(NgSwitch): update API doc
Closes #4423
2015-11-17 00:54:32 +00:00
vsavkin 4e585bca28 feat(build): add an option to disable type checks when running tests
Since editors and IDEs do typechecking and show errors in place,
often there is no benefit to running type checking in our test pipeline.
This PR allows you to disable type checking:

gulp test.unit.js --noTypeChecks

This commit also makes es6 generation optional.

fix(build): removes unnecessary circular dependencies

Closes #5299
2015-11-17 00:45:49 +00:00
Alex Rickabaugh 94cf671c15 docs(pipes): Add examples for all Angular pipes.
Closes #5103
2015-11-17 00:15:17 +00:00
vsavkin ad6fb067e9 fix(dart): fix the static_browser platform not to include compiler
Closes #5321
2015-11-16 23:29:36 +00:00
Peter Bacon Darwin c03fb36e11 docs(cheatsheet): add missing bootstrapping section
Closes #5269

Closes #5269
2015-11-16 23:15:03 +00:00
vsavkin 4e1d9c93df Revert "feat(Compiler): case sensitive html parser"
This reverts commit 86aeb8be0a.
2015-11-16 14:37:00 -08:00
vsavkin 0611239a0e Revert "feat(Compiler): case sensitive html parser"
This reverts commit a8edc1eb58.
2015-11-16 14:36:39 -08:00
Victor Berchet a8edc1eb58 feat(Compiler): case sensitive html parser
close #4417

Closes #5264
2015-11-16 21:09:09 +00:00
Tobias Bosch 86aeb8be0a feat(Compiler): case sensitive html parser 2015-11-16 21:09:09 +00:00
vsavkin e274ff8a69 Revert "feat(renderer): use a comment instead of an element when stamping out `<template>` elements"
This reverts commit bb9cfe6f36.
2015-11-16 11:15:28 -08:00
Tobias Bosch bb9cfe6f36 feat(renderer): use a comment instead of an element when stamping out `<template>` elements
Closes #4805


Closes #5227
2015-11-14 01:04:20 +00:00
Wassim Chegham b16fa45d83 docs(*): onContentInit --> afterContentInit
Closes #5263
2015-11-13 23:25:02 +00:00
Igor Minar 1d9c44b34f build: add --projects a.k.a the turbo button
we can now filter build graph via --project flag to speed up build performance

usage:

gulp test.unit.js --project=angular2,angular2_material

Closes #5272
2015-11-13 22:50:38 +00:00
vsavkin 0eab4fc72c feat(core): extract platforms out of core
Currently, core depends on the browser, which means that other platforms (e.g., NativeScript or webworker) cannot use the bootstrapping logic core provides.
This PR extract makes bootstrapping logic in core completely platform-independent. The browser-specific code was moved to "angular2/platforms/browser".

BREAKING CHANGE

A few private helpers (e.g., platformCommon or applicationCommon) were removed or replaced with other helpers. Look at PLATFORM_COMMON_PROVIDERS, APPLICATION_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS to see if they export the providers you need.

Closes #5219

Closes #5280
2015-11-13 19:26:14 +00:00
Alex Eagle 7f6289c1bf fix(typings): two errors not reported by our build:
third_party/javascript/angular2/github/modules/angular2/src/core/platform_bindings.ts:5:14: Exported variable 'EXCEPTION_PROVIDER' has or is using name 'Provider' from external module third_party/javascript/angular2/github/modules/angular2/src/core/di/provider but cannot be named.
third_party/javascript/angular2/github/modules/angular2/src/core/platform_bindings.ts:8:14: Exported variable 'EXCEPTION_BINDING' has or is using name 'Provider' from external module third_party/javascript/angular2/github/modules/angular2/src/core/di/provider but cannot be named.
third_party/javascript/angular2/github/modules/angular2/src/mock/animation_builder_mock.ts:11:10: Return type of public method from exported class has or is using private name 'MockCssAnimationBuilder'.
2015-11-12 18:39:23 -08:00
vsavkin 78280a48af Revert "feat(core): extract platforms out of core"
This reverts commit 3f4628c0b0.
2015-11-12 13:40:29 -08:00
vsavkin 3f4628c0b0 feat(core): extract platforms out of core
Currently, core depends on the browser, which means that other platforms (e.g., NativeScript or webworker) cannot use the bootstrapping logic core provides.
This PR extract makes bootstrapping logic in core completely platform-independent. The browser-specific code was moved to "angular2/platforms/browser".

BREAKING CHANGE

A few private helpers (e.g., platformCommon or applicationCommon) were removed or replaced with other helpers. Look at PLATFORM_COMMON_PROVIDERS, APPLICATION_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS to see if they export the providers you need.

Closes #5219
2015-11-12 16:57:03 +00:00
ericmartinezr 4e02e00373 feat(NgClass) allow multiple classes per expression
Closes #5225
2015-11-12 14:54:02 +00:00
Peter Bacon Darwin 9b3b721f08 docs(*): more cheatsheet docs 2015-11-11 16:32:25 -08:00
Peter Bacon Darwin 756727b930 docs(*): more cheatsheet docs 2015-11-11 16:32:25 -08:00
Peter Bacon Darwin 533b722c66 docs(*): move cheatsheet stuff into its own files 2015-11-11 16:32:25 -08:00
Peter Bacon Darwin 029c0534f3 docs(*): add initial cheatsheet tags 2015-11-11 16:32:25 -08:00
Igor Minar 4a43230de4 fix(core): various dart-specific fixes for core and facades
For some reason these showed up only now in internal Dart analyzer output.
2015-11-11 11:45:58 -08:00
Igor Minar 01ebff4080 fix(core): reexport PLATFORM_DIRECTIVES and PLATFORM_PIPES in dart
Looks like we missed this in the original PR.
2015-11-11 11:45:58 -08:00
Tobias Bosch 344776f864 fix(renderer): apply host element encapsulation also if the parent component is not encapsulated.
Closes #5240
2015-11-11 10:53:22 -08:00
Alex Rickabaugh a3e6406b38 fix(core): Export dev mode API in Dart.
Closes #5233
2015-11-11 07:18:11 +00:00
Alex Rickabaugh 1ff1792642 fix(core): Unload components when individually disposed. 2015-11-10 12:15:47 -08:00
Tobias Bosch e6bf33efbf patch(renderer): make `glyph` not an svg element
This is required because of a conflict with an internal project.
This will go away soon as we are working on a proper SVG 
support..
2015-11-10 11:51:39 -08:00
mlaval ee07646059 chore(test): fix public API test failure when no support of Symbol.for
`@@observable` is the token used in RxJS to define `Symbol.observable`

Closes #5093
2015-11-10 11:23:01 +01:00
vsavkin e27665c368 feat(core): renam AMBIENT_DIRECTIVES and AMBIENT_PIPES into PLATFORM_DIRECTIVES and PLATFORM_PIPES
After discussing it we decided that PLATFORM_ is a better prefix for directives available everywhere in the app.

BREAKING CHANGE

AMBIENT_DIRECTIVES -> PLATFORM_DIRECTIVES
AMBIENT_PIPES -> PLATFORM_PIPES

Closes #5201
2015-11-10 01:45:25 +00:00
Jeremy Elbourn 2618becaa5 chore(): npm release script for router artifacts.
Closes #5171
2015-11-09 20:45:55 +00:00
Victor Berchet 0dcca1a28e refactor(ListWrapper): drop filter, find, reduce & any
Closes #5152
2015-11-09 19:24:14 +00:00
Tobias Bosch e667ad3e6b refactor(compiler): make all commands const
Closes #5135
2015-11-09 10:59:08 -08:00
Tobias Bosch fb8b8157ff fix(setup): set tsconfig so that it works in editors 2015-11-09 08:43:15 -08:00
Alex Rickabaugh a8d9dbf110 feat(dart): Support forcing dev mode via enableDevMode in Dart.
Closes #5193
2015-11-09 07:16:25 +00:00
Trotyl Yu 2645fb0d6c docs(form): Fix typos of indent
Closes #5159
2015-11-07 16:05:56 +00:00
vsavkin 79472b77ca refactor(core): move facades out of core
This is part of ongoing work to make core platform-independent.

BREAKING CHANGE

All private exports from 'angular2/src/core/facade/{lang,collection,exception_handler}' should be replaced with 'angular2/src/facade/{lang,collection,exception_handler}'.
2015-11-07 01:36:06 +00:00
Yegor Jbanov 3593d85807 fix: remove deprecated zone API usage in testability
Closes #5084
2015-11-07 00:13:29 +00:00