Commit Graph

1986 Commits

Author SHA1 Message Date
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
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
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
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 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