Commit Graph

1373 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
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
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
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
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
Nathan Walker 019cb41dd8 fix(EventEmitter): resolve onError and onComplete asynchronously
closes #4443
2015-11-24 16:54:13 -08: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
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
mlaval 5806babb0b chore(build): increase timeout of the 5 most flaky tests
Closes #5410
2015-11-23 19:23:25 +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
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
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
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
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
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
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
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 1ff1792642 fix(core): Unload components when individually disposed. 2015-11-10 12:15:47 -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
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
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
Tobias Bosch 6133f2c08b fix(compiler): don’t lowercase attributes to support svg
This reverts commit b89c5bc581 and adds an additional test.

Closes #5166
2015-11-06 13:04:08 -08:00
Tim Blasi 63e853dcd7 feat(change_detect): Guard `checkNoChanges` behind `assertionsEnabled`
Always generate `checkNoChanges` tests, but guard them behind
`assertionsEnabled` tests.

Closes #4560
2015-11-06 11:59:03 -08:00
Pawel Kozlowski 2d0c8f1b0e fix(NgFor): allow default templates with ng-for-template
Closes #5161
2015-11-06 19:26:02 +00:00
Victor Berchet a0a627f2f9 refactor(StringWrapper): remove useless methods
Closes #5039
2015-11-06 17:04:01 +00:00
Alex Rickabaugh aa70275b01 chore(tests): Enable dev mode in all Angular tests.
Closes #5106
2015-11-06 07:07:04 +00:00
vsavkin 7343ef04ae feat(forms): remove controlsErrors
BREAKING CHANGE

Previously, the controlsErrors getter of ControlGroup and ControlArray returned the errors of their direct children. This was confusing because the result did not include the errors of nested children (ControlGroup -> ControlGroup -> Control). Making controlsErrors to include such errors would require inventing some custom serialization format, which applications would have to understand.

Since controlsErrors was just a convenience method, and it was causing confusing, we are removing it. If you want to get the errors of the whole form serialized into a single object, you can manually traverse the form and accumulate the errors. This way you have more control over how the errors are serialized.

Closes #5102
2015-11-06 01:47:37 +00:00
vsavkin 4439106a1f feat(facade): add support for async validators returning observables
Closes #5032
2015-11-06 01:20:03 +00:00
vsavkin 695923dcd6 refactor(core): move directives, pipes, and forms into common
BREAKING CHANGE

All private exports from 'angular2/src/core/{directives,pipes,forms}' should be replaced with 'angular2/src/common/{directives,pipes,formis}'

Closes #5153
2015-11-05 23:00:32 +00:00
vsavkin 6edd964a83 chore(core): move compiler out of core
BREAKING CHANGE

All imports from 'angular2/core/compiler' should be changed to 'angular2/compiler'.
2015-11-05 14:44:52 -08:00
Alex Rickabaugh fee5dea826 fix(forms): Export the NG_VALUE_ACCESSOR binding token.
This is needed to allow component authors to implement custom ControlValueAccessors for their input components.
2015-11-05 19:53:46 +00:00
Victor Berchet 7e92d2e6b7 feat(ChangeDetector): Add support for short-circuiting 2015-11-05 19:28:30 +00:00
Victor Berchet c56efc0c5f refactor(ChangeDetector): use View/ShadowDom & Content/LightDom consistently 2015-11-05 19:28:30 +00:00
Pawel Kozlowski f1989e7e1c fix(compiler): remove style when [style.foo]='exp' evaluates to null
Fixes #5110

Closes #5114
2015-11-05 06:50:46 +00:00
Jeff Cross a69e7fe297 fix(RouterLink): do not prevent default behavior if target set on anchor element
If the anchor element on which the "router-link" directive is present has a target
attribute other than "_self," the handler will not prevent default behavior of
the browser.

Closes #4233
Closes #5082
2015-11-04 19:55:46 +00:00
Rob Wormald 31687efd64 fix(http): use Response for JSONP errors
Return Response when JSONP backend errors
2015-11-04 19:19:50 +00:00
Julie Ralph 686457890d chore(test): rename RootTestComponent to ComponentFixture
BREAKING CHANGE:

Before:

```
testComponentBuilder.createAsync(MyComponent).then(root: RootTestComponent => {
}
```

After:

```
testComponentBuilder.createAsync(MyComponent).then(fixture: ComponentFixture => {
}
```

Closes #4711
2015-11-03 14:56:22 -08:00
vsavkin 5948abab7a feat(core): add support for ambient directives
Ambient directives can be configured when bootstraping an application.
Ambient directives can be used in every component of the application without
needing to explicitly list them.
2015-11-03 07:54:29 -08:00
vsavkin 1c322f13e5 feat(forms): update FormBuilder to support async validations
Closes #5020
2015-11-02 18:03:03 +00:00
vsavkin 31c12af81f feat(forms): add support for adding async validators via template
Example:

@Directive({
  selector: '[uniq-login-validator]',
  providers: [provide(NG_ASYNC_VALIDATORS, {useExisting: UniqLoginValidator, multi: true})]
})
class UniqLoginValidator implements Validator {
  validate(c) { return someFunctionReturningPromiseOrObservable(); }
}
2015-11-02 18:03:03 +00:00
vsavkin cf449ddaa9 feat(forms): implements a combinator for composing async validators 2015-11-02 18:03:02 +00:00
Misko Hevery 1b78342e23 chore(ngUpgrade): Move into Angular2
This is moving ngUpgrade into the main repository per #4838.
The ngUpgrade is published from the main import consistent with
https://docs.google.com/document/d/1rbVTKTYLz6p2smQNYI8h4-QN-m2PS6F3iQIDmSzn0Ww/edit#heading=h.6cxvr9awtf5r
Closes #4931
2015-10-31 20:48:27 -07:00
Brian Ford 0ebe283b37 feat(router): provide RouteConfig object for AuxRoute
Closes #4319
2015-10-30 17:26:12 -07:00
Tobias Bosch d8775e0e1f fix(shadow_css): strip comments and fix logic for parsing rules.
Closes #5037
Closes #5011
2015-10-30 16:28:26 -07:00
Stacy Gay fa44da16c8 refactor(linker): Expose ViewResolver to public api
Fixes https://github.com/angular/angular/issues/4780

Closes #4789
2015-10-29 21:21:04 -07:00
vsavkin 9d58f46ea5 fix(forms): update compose to handle null validators 2015-10-30 01:10:36 +00:00
vsavkin bb2b961f93 feat(forms): add support for async validations 2015-10-30 01:10:36 +00:00
Tobias Bosch 39626a944d fix(ng-content): wildcard ng-content has to go last.
This was the case before the new compiler landed and should be preserved. 

Related to #4598
Closes #5016
2015-10-29 16:51:16 -07:00
Alex Rickabaugh d1b54d6807 fix(core): Add an error state for ChangeDetectors that is set when bindings or lifecycle events throw exceptions and prevents further detection.
- Changes the `alreadyChecked` flag of AbstractChangeDetector to a new `state` flag.
- Changes all checks of alreadyChecked to check that the state is NeverChecked.
- Set state to Errored if an error is thrown during detection.
- Skip change detection for a detector and its children when the state is Errored.
- Add a test to validate this fixes issue #4323.

Closes #4953
2015-10-29 23:11:02 +00:00
Rob Wormald 389ed2d941 refactor(async): fix ObservableWrapper.isObservable
Makes ObservableWrapper and AsyncPipe work with Observable, Subject, and EventEmitter
2015-10-29 23:06:16 +00:00
Rob Wormald 0378e55fab chore(package): update RxJS version 2015-10-29 23:06:16 +00:00
Rob Wormald ca3986f31d refactor(async): refactor EventEmitter
Refactor EventEmitter and Async Facade to match ES7 Observable semantics, properly use RxJS typedefs, make EventEmitter inherit from RxJS Subject. Closes #4149.

BREAKING CHANGE:
- consumers of EventEmitter no longer need to call .toRx()
- EventEmitter is now generic and requires a type - e.g. `EventEmitter<string>`
- EventEmitter and Observable now use the `.subscribe(generatorOrNext, error, complete)` method instead of `.observer(generator)`
- ObservableWrapper uses `callNext/callError/callComplete` instead of `callNext/callThrow/callReturn`
2015-10-29 23:06:16 +00:00
Alex Rickabaugh 72e65d6797 refactor(core): Move LifeCycle functionality into ApplicationRef.
BREAKING CHANGE:

Before: constructor(@Inject(LifeCycle) lifecycle) { lifecycle.tick(); }
After: constructor(@Inject(ApplicationRef) appRef) { appRef.tick(); }

Closes #5008
2015-10-29 22:28:30 +00:00
Tobias Bosch 993b3d62de refactor(compiler): don’t rely on external css parser
We used to use different external css parsers,
depending on the `DomAdapter`. This lead to
inconsistent behavior and environment specific errors.

Closes #5006
Closes #4993
2015-10-29 15:09:39 -07:00
Vamsi V 7d83959be5 refactor(router): rename "as" to "name" in RouteConfig
BREAKING CHANGE:

This is a rename to make routing concepts easier to understand.

Before:

```
@RouteConfig([
  { path: '/', component: MyCmp, as: 'Home' }
])
```

After:

```
@RouteConfig([
  { path: '/', component: MyCmp, name: 'Home' }
])
```

Closes #4622

Closes #4896
2015-10-29 10:52:55 -07:00
mlaval e37799a2a5 fix(test): Android browser does not support calc() a CSS unit value
Closes #5001
2015-10-29 16:32:21 +00:00
mlaval c4964e7c9b fix(test): "integration tests svg should support svg elements" fails in non-Chrome browsers
Fixes #4987

Closes #5000
2015-10-29 16:03:15 +00:00
Victor Berchet 7677dc976e refactor(Pipes): integrate review feedback
Closes #4947
2015-10-29 00:50:52 +00:00
Victor Berchet e7f9924b18 style: clang format the code 2015-10-29 00:50:52 +00:00
Victor Berchet 40586152d1 test(Pipes): assert Date, Json & Slice are non pure 2015-10-29 00:50:52 +00:00
vsavkin e1337dc325 cleanup(forms): minor cleanup
Closes #4778
2015-10-29 00:02:01 +00:00
vsavkin 547e011abe feat(forms): add support for Validator
Currently, the only way for a directive to export a validator is by providing a function. This makes it ackward to write validators that depend on directive inputs. In addition to supporting functions as validators, classes implementing the Validator interface are supported too.
2015-10-29 00:02:01 +00:00
vsavkin f9963d3d21 refactor(di): minor cleanup 2015-10-28 07:32:40 -07:00
mgechev 6514b8ced0 fix(di): allow dependencies as flat array 2015-10-28 07:32:40 -07:00
Martin Probst c02f2bdab0 chore: adjust formatting to new clang-format.
- fixes wrapping for object literal keys called `template`.
- spacing in destructuring expressions.
- changes to keep trailing return types of functions closer to their
  function declaration.
- better formatting of string literals.

Closes #4828
2015-10-28 11:19:10 +01:00
Victor Berchet 1316c3e391 fix(ChangeDetector): support for NaN
Closes #4853
2015-10-28 00:44:06 +00:00
vsavkin 758062807a feat(forms): support adding validators to ControlGroup via template
Closes #4954
2015-10-28 00:13:20 +00:00
vsavkin f98faf0702 refactor(forms): make Validators.group and Validators.array private 2015-10-28 00:13:20 +00:00
Tobias Bosch 540b8c2a1a fix(renderer): support `xlink:href` attribute in svg
Closes #4956
2015-10-27 16:22:32 -07:00
gdi2290 dc6a066fed refactor(application): rename Binding into Provider
while creating the server version I noticed bindings are still
mentioned

Closes #4951
2015-10-27 22:39:22 +00:00
Tobias Bosch ac52bfd80f fix(render): create svg elements with the right namespace
Temporary fix for #4506
Closes #4949
2015-10-27 14:45:00 -07:00
Tobias Bosch 27dbd2ded4 fix(compiler): load style urls in runtime mode correctly
Closes #4952
2015-10-27 14:31:21 -07:00
vsavkin ed4826b08c feat(forms): Implement a way to manually set errors on a control
Example:

var login = new Control("someLogin");
c.setErrors({"notUnique": true});
expect(c.valid).toEqual(false);
expect(c.errors).toEqual({"notUnique": true});

c.updateValue("newLogin");
expect(c.valid).toEqual(true);

BREAKING CHANGE:

Before:

ControlGroup.errors and ControlArray.errors returned a reduced value of their children controls' errors.

After:

ControlGroup.errors and ControlArray.errors return the errors of the group and array.
And ControlGroup.controlsErrors and ControlArray.controlsErrors return the reduce value of their children controls' errors.

Closes #4917
2015-10-27 19:31:25 +00:00
cexbrayat b87da8f47c refactor(router): RouteData as a type
BREAKING CHANGE

The ROUTE_DATA token has been removed and replaced with a type RouteData,
allowing a type injection like we do with RouteParams.

Before:

    constructor(routeParams: RouteParams, @Inject(ROUTE_DATA) routeData) {
      let id = routeParams.get('id');
      let name = ROUTE_DATA.name;
    }

After:

    constructor(routeParams: RouteParams, routeData: RouteData) {
      let id = routeParams.get('id');
      let name = routeData.get('name');
    }

Fixes #4392

Closes #4428
2015-10-27 14:23:44 +00:00
Brian Ford 2a3e11d32d fix(router): respect LocationStrategy when constructing hrefs in links
Note that this introduces more behavior for LocationStrategy which needs
yet more refactoring to test. See #4935.

Closes #4333
2015-10-27 10:45:49 +00:00
Brian Ford 07cdc2ff44 feat(router): add support for route links with no leading slash
Closes #4623
2015-10-27 09:01:16 +00:00
Tobias Bosch d8b3601927 fix(style_url_resolver): include `asset:` urls into precompiled stylesheets.
Closes #4926
2015-10-26 17:19:33 -07:00
Tobias Bosch 60bedb43de fix(debug_element): don’t descend into merged embedded views on `componentChildren`.
Closes #4920
2015-10-26 16:39:49 -07:00
Alex Rickabaugh 2e059dc916 feat(router): Make RootRouter disposable to allow cleanup of Location subscription. ROUTER_PROVIDERS now automatically disposes of the RootRouter when the application is disposed.
Closes #4915
2015-10-26 21:35:18 +00:00
Alex Rickabaugh 8dd3082ea3 feat(core): PlatformRef and ApplicationRef support registration of disposal functions.
These functions will be called whenever the platform or application are being disposed.
2015-10-26 21:35:18 +00:00
Tobias Bosch b2dc5c2c7e fix(compiler): create literal property bindings for empty *… directives.
Closes #4916
2015-10-26 13:55:34 -07:00
Tobias Bosch 2957b0b32e fix(ng_class): support sets correctly
Previously, NgClass threw in Dart checked mode.

Closes #4910
2015-10-26 13:37:33 -07:00
vsavkin 28db864690 cleanup(forms): add missing tests 2015-10-26 11:50:30 -07:00
Ted Sander 28d88c5b12 feat(validators): Allow errors at both the group/array level or their children
Allow ControlGroups and ControlArrays to contain errors from their level, and
errors from their children. [Design Doc](https://docs.google.com/document/d/1EnJ3-_iFpVKFz1ifN1LkXSGQ7h3A72OQGry2g8eo7IA/edit?pli=1#heading=h.j53rt81eegm4)

BREAKING CHANGE: errors format has changed from validators. Now errors from
a control or an array's children are prefixed with 'controls' while errors
from the object itself are left at the root level.
Example:
Given a Control group as follows:
var group = new ControlGroup({
  login: new Control("", required),
  password: new Control("", required),
  passwordConfirm: new Control("", required)
});

Before:
group.errors

{
  login: {required: true},
  password: {required: true},
  passwordConfirm: {required: true},
}

After:
group.errors

{
  controls: {
    login: {required: true},
    password: {required: true},
    passwordConfirm: {required: true},
  }
}
2015-10-26 11:48:32 -07:00
Ted Sander c9fba3fa1f feat(validators): Add a pending state to AbstractControl
Add a pending state to AbstractControl and a function to set that state on
themselves and their parents. This will be used for both individual async
validators and when the imperitive mode is used. [Design Doc](https://docs.google.com/document/d/1EnJ3-_iFpVKFz1ifN1LkXSGQ7h3A72OQGry2g8eo7IA/edit?pli=1#heading=h.j53rt81eegm4)
2015-10-26 11:48:32 -07:00
Victor Berchet 04b4035ecd refactor(AppViewListener): prefix listener with on for consistency
Closes #3925
2015-10-26 18:28:27 +00:00
mikael d29a9a99aa fix(forms): handle control change in NgFormControl
when a new Control instance is bound to the directive, use the new instance, not the old one
2015-10-26 18:15:58 +00:00
Tobias Bosch 3118d5cebb fix(compiler): support events on a template element that are consumed via a direct expression
Closes #4883
2015-10-26 10:45:01 -07:00
Tobias Bosch 56a9b020d4 fix(default_value_accessor): support custom input elements that fire custom change events.
Closes #4878
2015-10-26 14:33:47 +00:00
Alberto Santini 785abe5a1d chore(http): remove double "var http" in http spec
Closes #4859
2015-10-22 10:08:35 +00:00
Victor Berchet 4639f449cf feat(Parser): associate pipes right to left
closes #4605

BREAKING CHANGE:

Before:

`1 + 1 | pipe:a | pipe:b` was parsed as `(1 + 1) | pipe:(a | pipe:b)`

After:

`1 + 1 | pipe:a | pipe:b` is parsed as `((1 + 1) | pipe:a) | pipe:b`

Closes #4716
2015-10-21 18:43:10 +00:00
Yegor Jbanov 77604b8b18 chore: add test showing CSS calc() failure 2015-10-21 11:02:55 -07:00
Yegor Jbanov 491e1fdd2c feat: move NgZone to Stream/Observable-based callback API
BREAKING CHANGES:
- deprecates these methods in NgZone: overrideOnTurnStart, overrideOnTurnDone, overrideOnEventDone, overrideOnErrorHandler
- introduces new API in NgZone that may shadow other API used by existing applications.
2015-10-20 21:51:19 -07:00
Yegor Jbanov 711dbf4975 fix(compiler): do not match directives to variable names
BREAKING CHANGES:
- you can no longer use a #foo or a var-foo to apply directive [foo], although
  it didn't work properly anyway.

This commit is fixing breakage caused by the switch to pre-compiler (exact SHA
unknown).
2015-10-20 20:31:55 -07:00
Victor Berchet 0a940211d5 feat(change detection): remove support for "if"
BREAKING CHANGE: Remove if statement support from actions.

Closes #4616
2015-10-20 18:15:08 +00:00
Tim Blasi fd0ba37734 refactor(dart): Format Dart code
Use the dart formatter to clean up all pure Dart code.

Closes #4832
2015-10-20 17:39:37 +00:00
Tobias Bosch fd9b67537d fix(url_resolver): always replace `package:` in Dart, even if it came from `baseUrl`.
Closes #4775
2015-10-15 16:57:54 -07:00
Julie Ralph d7ab5d44a5 fix(testing): let DOM adapter dictate XHR implementation for tests
The test injector now uses an XHR implementation based on DOM.getXHR,
which allows the current DOM adapter to dictate which XHR impl should
be used.

To prevent the changes to DOM adapter from introducing undesired new
dependencies into the benchmarks, separate the async facade into
a promise facade which is reexported by facade/async.

See #4539
2015-10-15 12:12:27 -07:00
vsavkin 65c737fc95 feat(forms): add input[type=number] value accessor
Closes #4014

Closes #4761
2015-10-15 18:41:17 +00:00
Marc Laval 427860a5bd chore(saucelabs): add Edge
Closes #4758
2015-10-15 18:20:41 +00:00
Tobias Bosch a941fb08f7 fix(style_compiler): don’t resolve absolute urls that start with a `/` during compilation
Closes #4763
2015-10-15 11:13:52 -07:00
Tobias Bosch cec8b58373 fix(compiler): explicitly support event bindings also on `<template>` elements
Although these events don’t fire events themselves, there might be directives on them that fire events.

Closes #4712
2015-10-15 10:08:22 -07:00
Marc Laval b89c5bc581 fix(compiler): attribute case in IE9
Closes #4743
2015-10-15 10:18:15 +02:00
Tobias Bosch 7dde18b181 fix(style_compiler): don’t touch urls in stylesheets and keep stylesheets with absolute urls in templates
We can’t resolve relative urls (e.g. for images) in the compiler as
these urls are meant to be loaded in the browser
(unless we would inline images as base64…).

Also, keep `<link rel=“stylesheet”>` in templates that
reference absolute urls with e.g. `http://`. This
behavior was already present for `@import` rules
within stylesheets.
Closes #4740
2015-10-15 01:42:48 +00:00
Kevin Moore a91ae291e4 fix(test) fix Dart annotation for integration_dart_spec.dart 2015-10-15 00:19:31 +00:00
vsavkin b716d2335b fix(forms): emit value changes after errors and status are set
Closes #4714
2015-10-14 19:36:43 +00:00
vsavkin bfbf18d983 feat(query): add filter and reduce to QueryList
Closes #4710
2015-10-13 23:52:17 +00:00
vsavkin e82a35d1fd feat(forms): add minlength and maxlength validators
Closes #4705
2015-10-13 21:42:12 +00:00
Marc Laval e15e2428c5 fix(test): command compiler attr merge test in IE 2015-10-13 13:39:32 -07:00
Matias Niemelä 1bc35208df test(router): add testing code for querystring serialization 2015-10-13 12:06:22 -07:00
Brian Ford c0b7bae9d3 test(router): add missing tests for the url parser 2015-10-13 12:06:22 -07:00
Julie Ralph f529236bfc refactor(test): rename test_lib to testing
Old test_lib is now testing_internal
test_lib_public is now testing
2015-10-13 10:36:49 -07:00
Julie Ralph a1fa2e472f feat(test): Add an external version of the test library
Adds test adapters for TypeScript and JavaScript only, exported
as part of the test_lib module. These work with the Jasmine test
framework, and allow use of the test injector within test blocks
via the `inject` function.

See #4572, #4177, #4035, #2783

This includes the TestComponentBuilder. It allows using the
test injector with Jasmine bindings, and waits for returned
promises before completing async test blocks.
2015-10-12 23:14:03 -07:00
vsavkin 1aeafd31bd feat(di): change the params of Provider and provide to start with "use"
Closes #4684
2015-10-12 21:09:09 +00:00
Igor Minar 6abed8d996 fix(test_lib): don't mock out XHR via MockXHR by default in tests
This is useful for the compiler tests, but otherwise it's not useful.

Additionally if an application has external templates (as is common) then
we should actually fetch these templates in tests.

Fixes #4539

Closes #4682
2015-10-12 17:45:19 +00:00
Tobias Bosch eacc8e3803 fix(compiler): merge `class` and `style` attributes from the element with the host attributes
Closes #4583
Closes #4680
2015-10-12 15:35:49 +00:00
Marc Laval 0def28e594 fix(compiler): shadow CSS @import test in some browsers
Closes #4629
2015-10-12 00:28:07 +02:00
vsavkin 1eb0162cde feat(di): rename Binding into Provider
Closes #4416

Closes #4654
2015-10-11 05:13:31 +00:00
vsavkin 7c6130c2c5 feat(core): desugar [()] to [prop] and (prop-change)
BREAKING CHANGE

Before

```
<cmp [(prop)]="field"> was desugared to <cmp [prop]="field" (prop)="field=$event">
```

After
```
<cmp [(prop)]="field"> is desugared to <cmp [prop]="field" (prop-change)="field=$event">
```

Closes #4658
2015-10-11 02:58:13 +00:00
Alex Rickabaugh 90191ce261 refactor(router): use ApplicationRef to provide the first bootstrapped component as ROUTER_PRIMARY_COMPONENT automatically.
This removes the routerBindings function as it is no longer necessary. ROUTER_BINDINGS will automatically pick the first bootstrapped component to satisfy ROUTER_PRIMARY_COMPONENT.

BREAKING CHANGE:

Before: bootstrap(MyComponent, [routerBindings(myComponent)]);
After: bootstrap(MyComponent, [ROUTER_BINDINGS]);

Closes #4643
2015-10-10 05:19:55 +00:00
Misko Hevery cd90e6ed8f feat(ngUpgrade): support for content project from ng1->ng2 2015-10-09 21:25:45 -07:00
Alex Eagle 95f984615b Produce .d.ts files from our typescript compilation.
Deliver them into our npm module output so users can consume them directly.

Fixes #3082
2015-10-10 02:18:33 +00:00
Tobias Bosch 6207b1af88 feat(ngFor): support a custom template
Part of #1989

Closes #4637
2015-10-09 21:52:59 +00:00
Victor Berchet a8c34ae290 refactor(MapWrapper): drop delete(), get(), forEach() and size
Closes #4618
2015-10-09 20:07:43 +00:00
vsavkin f3ab527688 resolve rebase conflicts 2015-10-08 13:59:09 -07:00
vsavkin bba0248989 fix(core): remove NgZone_ and use NgZone instead 2015-10-08 13:55:26 -07:00
vsavkin 14fa00791e fix(analyzer): fix dart analyzer errors 2015-10-08 13:54:44 -07:00
vsavkin d60c7a9118 fix(tests): fixes public api spec 2015-10-08 13:54:44 -07:00
vsavkin d63f3c123e fix benchmarks 2015-10-08 13:54:44 -07:00
vsavkin 8b725c77fd fix(tests): fix tests 2015-10-08 13:54:44 -07:00
Alex Eagle 5458036de7 fix(typings): update test.typings for abstract superclasses 2015-10-08 13:54:43 -07:00
Alex Eagle 6075509f26 chore(typing): extract abstract superclasses to replace @private constructors 2015-10-08 13:54:43 -07:00
Brian Ford ee32b1bc37 feat(router): allow async routes to be defined with "loader" 2015-10-08 12:29:14 -07:00
Tobias Bosch 6d4bd5d901 fix(render): recurse into components/embedded templates not until all elements in a view have been visited
Fixes #4551
Closes #4601
2015-10-08 11:43:21 -07:00
Yegor Jbanov 04b3dee667 fix(css): when compiling CSS, leave absolute imports alone
Closes #4592
2015-10-08 16:39:32 +00:00
Victor Berchet 6b00b60488 fix(XhrBackend): setRequestHeader takes a string arg
Closes #4597
2015-10-08 15:59:10 +00:00
Victor Berchet aee176115b refactor(ListWrapper): drop forEach and removeLast
Closes #4584
2015-10-07 17:17:31 +00:00
Victor Berchet a0277f1b3a refactor: add missing types for ts2dart
Closes #4568
2015-10-07 06:39:14 +00:00
Victor Berchet aaa215514b refactor(ListWrapper): get ride of ListWrapper.map 2015-10-07 06:39:14 +00:00
Igor Minar 15ab6f6ea8 fix(location): improve the 'No base href set' error message 2015-10-06 20:59:02 -07:00
vsavkin dea6a4593b cleanup(core): making @View optional
Closes #4566
2015-10-07 02:16:42 +00:00
vsavkin bd31b01690 feat(core): add syntax sugar to make @View optional 2015-10-07 02:16:42 +00:00
Tim Blasi a4869c874b build(dart): Remove unused Dart benchmarks 2015-10-06 14:11:03 -07:00
Alex Eagle 6093e28b61 fix(typings): repair broken typechecks
We had the typechecker disabled by accident, and many problems snuck in

Fixes #4507

Closes #4508
2015-10-06 13:28:17 +00:00
Tobias Bosch 0b3e4fa090 refactor(core): move `ViewEncapsulation` and `ViewType` to the right places
Closes #4526
2015-10-05 11:22:21 -07:00
Tobias Bosch 0299d4af00 fix(core): keep styles for `ViewEncapsulation.Native` isolated per component
BREAKING CHANGE:
- `Renderer.registerComponent` now takes an additional argument.

Fixes #4513
Closes #4524
2015-10-05 10:34:42 -07:00
Tobias Bosch a9aef8e5e6 fix(core): set `ViewEncapsulation.Emulated` as the default again
Fixes #4494
2015-10-05 10:33:58 -07:00
Tobias Bosch 6fe8b85295 fix(render): keep bindings of components in content and view in the right order
Bindings in the component view have to be first, before 
bindings of components in the light dom (i.e. have the same
order as used in the `ViewManagerUtils.createView()` method.

Fixes #4522
Closes #4523
2015-10-05 10:10:47 -07:00
Alex Eagle 208f3d4c65 fix(typings): repair broken type-checking for StringMap
Note that the previous type of StringMap was overly permissive and didn't catch errors.
Also we have to explicitly type empty objects, which is explained here:
https://github.com/Microsoft/TypeScript/issues/5089

Closes #4487
2015-10-03 01:09:42 +00:00
Alex Eagle 7c4199cd1c chore(typings): remove StringMap
This was a poorly typed attempt to mimic TypeScript's index signatures,
which we can use instead.
This eliminates a very strange type that we were exposing to users, but
not re-exporting through our public API.

Fixes #4483
2015-10-03 01:09:42 +00:00
Rob Wormald 01fb06a377 chore(http): Use Observables in Http
- Remove ObservableWrapper/EventEmitter from Http.
- Temporarily use complete Rx build w/ all operators.
2015-10-02 17:20:25 -07:00
vsavkin c9901c5fe0 feat(core): support properties and events in addition to inputs and outputs to make transition easier
Closes #4482
2015-10-02 23:23:15 +00:00
Tobias Bosch 13161ae5aa refactor(core): move APP_ID from render/dom/dom_tokens into application_tokens 2015-10-02 13:38:52 -07:00
Tobias Bosch 6b5d345a2b refactor(core): adjust imports for move files to the right place
- render/xhr_* -> compiler/xhr_*
- render/event_config -> linker/event_config
- render/dom/schema -> compiler/schema
- render/dom/compiler/* -> compiler/*
- render/dom/view/shared_styles_host -> render/dom/shared_styles_host
2015-10-02 13:38:51 -07:00
Tobias Bosch 2450a3c5b0 refactor(core): move files to the right place
- render/xhr_* -> compiler/xhr_*
- render/event_config -> linker/event_config
- render/dom/schema -> compiler/schema
- render/dom/compiler/* -> compiler/*
- render/dom/view/shared_styles_host -> render/dom/shared_styles_host
- services/url_resolver -> compiler/url_resolver
- services/app_root_urlo -> compiler/app_root_url
2015-10-02 13:38:51 -07:00
mgechev 34518f0f2d feat(http): Add support for strings as http method names
Closes #4331
2015-10-02 11:33:49 -07:00
Tobias Bosch e8e57cdd73 refactor(core): adjust imports for rename angular2/src/compiler -> angular2/src/core/compiler 2015-10-02 08:59:43 -07:00
Tobias Bosch aa3d94149f refactor(core): rename angular2/src/compiler -> angular2/src/core/compiler 2015-10-02 08:42:12 -07:00
Tobias Bosch 6248a5e846 refactor(core): move core/compiler to core/linker, adjust imports 2015-10-02 08:42:12 -07:00
Tobias Bosch 9f4fa1ab0a refactor(core): move core/compiler to core/linker 2015-10-02 08:42:11 -07:00
Tobias Bosch d21c7bdf90 refactor(compiler): remove unused code
BREAKING CHANGE:
- Removes `ChangeDetection`, use a binding for `ChangeDetectorGenConfig` instead
  to configure change detection.
- `RenderElementRef.renderBoundElementIndex` was renamed to `RenderElementRef.boundElementIndex`.
- Removes `ViewLoader`, use `XHRImpl` instead.
2015-10-01 22:27:41 -07:00
Tobias Bosch 76247b7097 refactor(compiler): use the new compiler everywhere
Closes #3605

BREAKING CHANGE:
- we don't mark an element as bound any more if it only contains text bindings
  E.g. <div>{{hello}}</div>
  This changes the indices when using `DebugElement.componentViewChildren` / `DebugElement.children`.
- `@Directive.compileChildren` was removed,
  `ng-non-bindable` is now builtin and not a directive any more
- angular no more adds the `ng-binding` class to elements with bindings
- directives are now ordered as they are listed in the View.directives regarding change detection.
  Previously they had an undefined order.
- the `Renderer` interface has new methods `createProtoView` and `registerComponentTemplate`. See `DomRenderer` for default implementations.
- reprojection with `ng-content` is now all or nothing per `ng-content` element
- angular2 transformer can't be used in tests that modify directive metadata.
  Use `angular2/src/transform/inliner_for_test` transformer instead.
2015-10-01 18:48:27 -07:00
Yegor Jbanov 841f8789fd refactor(transformer): precompile stylesheets
Part of #3605
2015-10-01 18:48:27 -07:00
vsavkin adbfd29fd7 feat(core): renames Property into Input and Event into Output
BREACKING CHANGE:

Before: @Directive({properties: ['one'], events: ['two']})
After: @Directive({inputs: ['one'], outputs: ['two']})

Before: @Component({properties: ['one'], events: ['two']})
After: @Componet({inputs: ['one'], outputs: ['two']})

Before: class A {@Property() one; @Event() two;}
After: class A {@Input() one; @Output() two;}
2015-10-01 04:36:23 +00:00
vsavkin 00a4b2e28f feat(forms): make NgControl -> NgValueAccessor dependency unidirectional
Closes #4421
2015-10-01 01:47:18 +00:00
vsavkin cec4b36d9b fix(change_detection): _throwError should not mask the original exception 2015-09-30 18:18:28 -07:00
Marc Laval eafa482052 chore(saucelabs): add latest Safaris
Closes #4411
2015-09-30 21:38:04 +00:00
vsavkin 3aa204791b feat(query): make QueryList notify on changes via an observable
BREAKING CHANGE:

Before: query.onChange(() => ...);
After: query.changes.subscribe((iterable) => {});

Closes #4395
2015-09-30 15:45:16 +00:00
Alex Eagle 9b7378d132 chore(typings): remove traceur-runtime.d.ts
fixes #4297

Closes #4415
2015-09-30 00:07:16 +00:00
Alex Eagle b4fe590b2d chore(ts): fix TODOs that were pending on 1.6 upgrade
Closes #4377
2015-09-29 03:23:25 +00:00
Tobias Bosch 8ff65a30c7 refactor(compiler): don’t require `id` in metadata and use `appId`
The output of the compiler has to be the same
given the same input. Requiring a unique id for
every type already during compilation makes it
hard to parallelize compilation.

Part of #3605
Closes #4397
2015-09-28 19:47:24 -07:00
cexbrayat e2f5d87ff7 fix(services): export title service
Signed-off-by: cexbrayat <cedric@ninja-squad.com>

Closes #4271
2015-09-28 23:23:40 +00:00
Alex Rickabaugh 7714d6a6eb fix(forms): avoid issues with nulls checking on validation status and other form states.
Closes #4338
2015-09-28 21:01:51 +00:00
Rob Wormald a88e6f3106 refactor(http): use Observables in Http backends
BREAKING CHANGE: Http now returns Rx Observables directly, so calling .toRx() is no longer necessary. Additionally, Http calls are now cold, so backend requests will not fire unless .subscribe() is called.

closes #4043 and closes #2974

Closes #4376
2015-09-27 22:15:30 +00:00
Victor Berchet 0319417a1b feat(Binding): improve errors
fix #4358

Closes #4360
2015-09-25 22:05:36 +00:00
Tobias Bosch 1cf45757cd feat(render): add generic view factory based on the template commands
Part of #3605
Closes #4367
2015-09-25 11:56:58 -07:00
Tobias Bosch 0ed6fc4f6b fix(compiler): minor cleanups and fixes
Part of #3605
2015-09-25 11:27:39 -07:00
Marc Laval 9c9769047d fix(test): StyleCompiler tests failing in Android browsers
Closes #4351
2015-09-25 07:34:17 +00:00
Victor Berchet 0a88e7b736 feat(change detection): export SimpleChange
Closes #4337
2015-09-25 02:33:41 +00:00
vsavkin 4efc4a5520 feat(query): remove the 3-query-per-element limit
Closes #4336
2015-09-24 21:09:02 +00:00
vsavkin 225eab8f25 cleanup(change_detection): make Locals private
Closes #4321
2015-09-24 18:10:47 +00:00
vsavkin 7c2c1a8e03 docs(change_detection): add docs to ChangeDetectorRef 2015-09-24 18:10:47 +00:00
Tobias Bosch 7470ad1bd1 refactor(compiler): various cleanups
- use `$implicit` variable value correctly
- handle `ng-non-bindable` correctly
- add some more assertions to `TemplateCompiler`
- make `CompiledTemplate` const
- fix default value for `@Directive.moduleId`
- add new compiler to application bindings

BREAKING CHANGE:
- `Compiler.compileInHost` and all methods of `DynamicComponentLoader` don’t take `Binding` any more, only `Type`s. This is in preparation for the new compiler which does not support this.

Part of #3605

Closes #4346
2015-09-24 10:56:29 -07:00
Marc Laval bffa2cb59b feat(animate): cross-browser compatibility
Closes #4243
2015-09-24 10:24:40 +02:00
Misko Hevery 8427863bab feat(upgrade): Allow including ng2/1 components in ng1/2
Closes #3539
2015-09-23 05:02:43 +00:00
Brian Ford 41b019f5f8 refactor(router): do not export RootRouter
BREAKING CHANGE:

It's unlikely that any apps were explicitly referencing `RootRouter`, but if they were they should
prefer to use the `routerBindings` helper or the `ROUTER_BINDINGS` const exported from `angular2/router`
2015-09-22 23:51:19 +00:00
Misko Hevery af2cd4d6f3 fix(api): align dart/js APIs 2015-09-22 23:11:40 +00:00
Alex Eagle 577ee3744a fix(bug): reflect Dart interfaces from superclass as well
fixes #4221

Closes #4222
2015-09-22 22:31:07 +00:00
vsavkin 238dfc1e17 cleanup(di): make KeyRegistry private 2015-09-22 21:38:33 +00:00
vsavkin 29b56ceb40 cleanup(di): make DependencyProvider private 2015-09-22 21:38:33 +00:00
Tobias Bosch cc0c30484f refactor(compiler): cleanup and preparation for integration
- Rename `DirectiveMetadata` into `CompileDirectiveMetadata`, merge
  with `NormalizedDirectiveMetadata` and remove `ChangeDetectionMetadata`
- Store change detector factories not as array but
  directly at the `CompiledTemplate` or the embedded template
  to make instantiation easier later on
- Already analyze variable values and map them
  to `Directive.exportAs`
- Keep the directive sort order as specified in the
  `@View()` annotation
- Allow to clear the runtime cache in `StyleCompiler`
  and `TemplateCompiler`
- Ignore `script` elements to match the semantics of the
  current compiler
- Make all components dynamically loadable and remove
  the previously introduced property `@Component#dynamicLoadable`
  for now until we find a better option to configure this
- Don’t allow to specify bindings in `@View#directives` and `@View#pipes` as this was never supported by the transformer (see below for the breaking change)

BREAKING CHANGE:
- don't support DI bindings in `@View#directives` and `@View@pipes` any more in preparation of integrating the new compiler. Use `@Directive#bindings` to reexport directives under a different token instead.

Part of #3605
Closes #4314
2015-09-22 12:50:03 -07:00
vsavkin b0effe8e27 docs(di): add docs to Injector
Closes #4254
2015-09-21 21:55:04 +00:00
vsavkin c2a60f1624 feat(core): add support for @ContentChild and @ViewChild
Closes #4251
2015-09-20 01:45:09 +00:00
vsavkin 2e9de0b169 feat(core): add sugar to use ContentChildren and ViewChildren as prop decorators
Closes #4237
2015-09-20 00:43:04 +00:00
vsavkin 5dbe292615 feat(core): add support for ContentChildren and ViewChildren 2015-09-20 00:43:04 +00:00
Brian Yarger 3525d8a394 fix(http): throw if url is not string or Request
Closes #4245

Closes #4257
2015-09-18 23:33:17 +00:00
Marc Laval 390aacd442 fix(facade): workaround for lack of Symbol.iterator in es6-shim
Closes #4219
Fixes #4216
2015-09-18 09:46:13 +02:00
Pascal Precht 5a3ce87915 chore(http): remove unused properties from Request
This removes properties mentioned in #3339

Closes #3339
Closes #3823
2015-09-17 17:16:47 -07:00
Tobias Bosch f490565b09 refactor(compiler): cleanup method and property names
Closes #4236
2015-09-17 20:41:37 +00:00
Tobias Bosch 457b689bf0 feat(compiler): add TemplateCompiler
TemplateCompiler is the entry point to the new compiler

Related to #3605
Closes #4220
2015-09-17 04:24:15 +00:00