Commit Graph

1164 Commits

Author SHA1 Message Date
40586152d1 test(Pipes): assert Date, Json & Slice are non pure 2015-10-29 00:50:52 +00:00
e1337dc325 cleanup(forms): minor cleanup
Closes #4778
2015-10-29 00:02:01 +00:00
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
f9963d3d21 refactor(di): minor cleanup 2015-10-28 07:32:40 -07:00
6514b8ced0 fix(di): allow dependencies as flat array 2015-10-28 07:32:40 -07:00
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
1316c3e391 fix(ChangeDetector): support for NaN
Closes #4853
2015-10-28 00:44:06 +00:00
758062807a feat(forms): support adding validators to ControlGroup via template
Closes #4954
2015-10-28 00:13:20 +00:00
f98faf0702 refactor(forms): make Validators.group and Validators.array private 2015-10-28 00:13:20 +00:00
540b8c2a1a fix(renderer): support xlink:href attribute in svg
Closes #4956
2015-10-27 16:22:32 -07:00
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
ac52bfd80f fix(render): create svg elements with the right namespace
Temporary fix for #4506
Closes #4949
2015-10-27 14:45:00 -07:00
27dbd2ded4 fix(compiler): load style urls in runtime mode correctly
Closes #4952
2015-10-27 14:31:21 -07:00
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
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
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
07cdc2ff44 feat(router): add support for route links with no leading slash
Closes #4623
2015-10-27 09:01:16 +00:00
d8b3601927 fix(style_url_resolver): include asset: urls into precompiled stylesheets.
Closes #4926
2015-10-26 17:19:33 -07:00
60bedb43de fix(debug_element): don’t descend into merged embedded views on componentChildren.
Closes #4920
2015-10-26 16:39:49 -07:00
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
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
b2dc5c2c7e fix(compiler): create literal property bindings for empty *… directives.
Closes #4916
2015-10-26 13:55:34 -07:00
2957b0b32e fix(ng_class): support sets correctly
Previously, NgClass threw in Dart checked mode.

Closes #4910
2015-10-26 13:37:33 -07:00
28db864690 cleanup(forms): add missing tests 2015-10-26 11:50:30 -07:00
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
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
04b4035ecd refactor(AppViewListener): prefix listener with on for consistency
Closes #3925
2015-10-26 18:28:27 +00:00
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
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
56a9b020d4 fix(default_value_accessor): support custom input elements that fire custom change events.
Closes #4878
2015-10-26 14:33:47 +00:00
785abe5a1d chore(http): remove double "var http" in http spec
Closes #4859
2015-10-22 10:08:35 +00:00
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
77604b8b18 chore: add test showing CSS calc() failure 2015-10-21 11:02:55 -07:00
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
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
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
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
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
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
65c737fc95 feat(forms): add input[type=number] value accessor
Closes #4014

Closes #4761
2015-10-15 18:41:17 +00:00
427860a5bd chore(saucelabs): add Edge
Closes #4758
2015-10-15 18:20:41 +00:00
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
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
b89c5bc581 fix(compiler): attribute case in IE9
Closes #4743
2015-10-15 10:18:15 +02:00
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
a91ae291e4 fix(test) fix Dart annotation for integration_dart_spec.dart 2015-10-15 00:19:31 +00:00
b716d2335b fix(forms): emit value changes after errors and status are set
Closes #4714
2015-10-14 19:36:43 +00:00
bfbf18d983 feat(query): add filter and reduce to QueryList
Closes #4710
2015-10-13 23:52:17 +00:00
e82a35d1fd feat(forms): add minlength and maxlength validators
Closes #4705
2015-10-13 21:42:12 +00:00
e15e2428c5 fix(test): command compiler attr merge test in IE 2015-10-13 13:39:32 -07:00