Commit Graph

2851 Commits

Author SHA1 Message Date
Misko Hevery 6402d61f69 chore: fix up ngClass for types/export missing public API
Closes #7202
2016-03-04 08:03:55 +00:00
Julie Ralph 5a59e44765 chore(test): migrate Dart tests to package:test
Instead of running with karma and the karma-dart shim, run dart
tests directly using the new package:test runner. This migrates
away from package:unittest.

Fixes a couple tests, mostly associated with depending on absolute
URLs or editing the test providers after an injector had already
been created.

Remove karma-dart and associated files. Change gupfiles to run tests
via `pub run test` instead.
2016-03-04 02:27:44 +00:00
Vikram Subramanian 7455b907d1 Revert "feat(dart): Add a dev-mode check for undeclared lifecycle interfaces"
This reverts commit a3d7629134.

Needs co-ordination with google3 changes.
2016-03-03 18:00:18 -08:00
Kevin Moore 579b890446 chore(dart) Update dev dependency on code_tranformers
Closes https://github.com/angular/angular/issues/6665
2016-03-03 23:12:02 +00:00
Chuck Jazdzewski 19a08f3a43 feat(compiler): Added spans to HTML parser errors
Allows using the HTML parser in contexts errors are reported in a development tool such as an editor.
2016-03-03 22:51:57 +00:00
Tim Blasi a3d7629134 feat(dart): Add a dev-mode check for undeclared lifecycle interfaces
Add a check in `ReflectionCapabilities#interfaces` which determines if
the passed-in type implements a Lifecycle Interface but does not declare
that it does so.

See https://goo.gl/b07Kii for details.

Closes #6849
2016-03-03 22:45:50 +00:00
Tobias Bosch a10c02cb41 feat(iterable_differ): support immutable lists
Closes #7127
2016-03-03 18:29:01 +00:00
Vikram Subramanian 9936e347ff chore(build): Remove circular dependency in Angular 2 ES5 output.
Remove couple of circular dependency between modules in Angular 2 ES5 output caused by exception_handler.ts and router_providers.ts.

Fix the build/checkCircularDependency gulp task to call madge properly to detect the circular deps.

Closes #7287
2016-03-03 17:42:33 +00:00
Brian Ford 7d44b8230e fix(router): support outlets within dynamic components
Fixes internal b/27294172
2016-03-03 06:49:29 -08:00
Brian Ford 75343eb340 feat(router): add regex matchers
@petebacondarwin deserves credit for most of this commit.

This allows you to specify a regex and serializer function instead
of the path DSL in your route declaration.

```
@RouteConfig([
  { regex: '[a-z]+.[0-9]+',
    serializer: (params) => `{params.a}.params.b}`,
    component: MyComponent }
])
class Component {}
```

Closes #7325
Closes #7126
2016-03-02 16:08:19 -08:00
Peter Bacon Darwin 2548ce86db fix(angular1_router): rename `router` component binding to `$router`
The current router is passed to the current component via a binding.
To indicate that this is an angular provided object, this commit
renames the binding to `$router`.

BREAKING CHANGE:

The recently added binding of the current router to the current component
has been renamed from `router` to `$router`.

So now the recommended set up for your bindings in your routed component
is:

```js
{
  ...
  bindings: {
    $router: '<'
  }
}
```
2016-03-02 16:08:19 -08:00
Peter Bacon Darwin 5586c29492 fix(angular1_router): support templateUrl components 2016-03-02 16:08:19 -08:00
Peter Bacon Darwin 1174473e9c fix(angular1_router): rename `router` component binding to `$router`
The current router is passed to the current component via a binding.
To indicate that this is an angular provided object, this commit
renames the binding to `$router`.

BREAKING CHANGE:

The recently added binding of the current router to the current component
has been renamed from `router` to `$router`.

So now the recommended set up for your bindings in your routed component
is:

```js
{
  ...
  bindings: {
    $router: '<'
  }
}
```
2016-03-02 16:08:19 -08:00
Jason Teplitz 69c1694900 fix(WebWorker): Make MessageBus EventEmitter synchronous 2016-03-01 23:23:17 +00:00
Jason Teplitz 01fe7f5fac fix(WebWorker): Fix PostMessageBusSink and Source undefined error.
Closes #7156
2016-03-01 14:40:09 -08:00
vsavkin 39b6e0efba feat(transformers): collect information for CompileDiDependencyMetadata 2016-03-01 13:28:36 -08:00
Tobias Bosch f60fa14767 feat(core): drop `ChangeDetectionStrategy.OnPushObserve`
BREAKING CHANGE:

`OnPushObserve` was an experimental
feature for Dart and had
conceptual performance problems,
as setting up observables is slow.
Use `OnPush` instead.
2016-03-01 13:28:10 -08:00
Julie Ralph d900f5c075 chore(tests): lengthen timeout for templateUrl test
This was flaking on Travis occasionally because the TestComponentBuilder
is actually doing an XHR, and it was slow on the Edge browser.

Closes #7293
2016-03-01 21:01:56 +00:00
Kara Erickson 59629a0801 feat(i18n): added i18nPlural and i18nSelect pipes
Closes #7268
2016-03-01 16:40:48 +00:00
Tobias Bosch b5e6319fa9 feat(core): add more debug APIs to inspect the application form a browser
Adds `window.getAllAngularRootElements()`
Adds `ng.coreTokens.ApplicationRef`
Adds `ng.coreTokens.Ngzone`

Closes #7045
Closes #7161
2016-03-01 16:01:28 +00:00
Tobias Bosch c9a3df970b feat(di): drop support for injecting types with generics in Dart
BREAKING CHANGE:
In Dart we used to support injecting types with generics. As this feature is hard to implement with the upcoming codegen we are dropping it.

Merge cl/115454020 in G3 with this change.
Closes #7262
2016-03-01 05:43:49 +00:00
vsavkin 05c185a7b1 fix(transformers): record reflection info about abstract classes
Closes #7347
2016-02-29 22:57:22 +00:00
Misko Hevery b47f80ec76 fix(Router): Query strings are copied for HashLocationStrategy
b/27210802 P1

Closes #7298
2016-02-29 18:44:56 +00:00
Tobias Bosch ebd438ff5e fix(change_detection): allow to destroy `OnPush` components inside of a host event.
Closes #7192
2016-02-29 18:44:13 +00:00
Jeff Cross 4a93f58b8b fix(web_worker): wait for bindings in kitchen sink spec 2016-02-26 10:34:32 -08:00
vsavkin ebe531bf92 feat(transformers): collect data needed for the template compiler
Closes #7299
2016-02-26 17:56:40 +00:00
Tobias Bosch 1779caf5f8 fix(core): support `ngFor` that has an `ngIf` as last node
Fixes #6304
Closes #6878
2016-02-25 23:42:17 +00:00
Robert Ferentz 6ef2121e6a feat(pipes): add ReplacePipe for string manipulation
add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.
2016-02-25 22:56:13 +00:00
Alec Wiseman 38cb526f60 feat(forms/validators): pattern validator
Adding static pattern validation method to Validators

Adding a directive for the pattern validator

Applying clang-format rules to modified files

Updating public api spec for new pattern validator

Adding pattern validator to public api guard tool

For #5411

Closes #5561
2016-02-25 22:39:15 +00:00
Jeff Cross f6a8d04c32 fix(web_workers): make waitForElementText function more stable 2016-02-25 14:28:20 -08:00
Julie Ralph abff302e52 chore(tests): fix broken test from using the wrong xit
Also, run clang-format.
2016-02-25 10:50:59 -08:00
Julie Ralph aaafdf03ce test(testing): add a test to ensure fakeAsync works with angular2/testing 2016-02-25 10:22:18 -08:00
vsavkin ee298baa1b test(router): disable a flaky test 2016-02-25 10:21:53 -08:00
Kara Erickson ab36ea097b fix(differ): clean up stale identity change refs
Closes #7193
2016-02-24 17:56:55 -08:00
Misko Hevery 8bb66a5eb3 chore: noImplicitAny fixes 2016-02-24 15:29:00 -08:00
Peter Bacon Darwin cfc1e56dd8 refact(angular1_router): make the `$$router` binding one-time
This binding is never going to change so we can make it a one-time binding

Closes #6978
2016-02-24 21:15:34 +00:00
Peter Bacon Darwin a1c3be21ec fix(angular1_router): rename `$route` service to `$rootRouter`
The singleton service that represents the top level router was called
`$router` but this is confusing since there are actually lots of routers,
which depend upon where you are in the DOM. This is similar to the situation
with scopes.

This commit clarifies this singleton by renaming it to `$rootRouter`.

BREAKING CHANGE:

The `$router` injectable service has been renamed to `$rootRouter`
2016-02-24 21:15:34 +00:00
Peter Bacon Darwin edad8e3f56 fix(angular1_router): rename `router` component binding to `$router`
The current router is passed to the current component via a binding.
To indicate that this is an angular provided object, this commit
renames the binding to `$router`.

BREAKING CHANGE:

The recently added binding of the current router to the current component
has been renamed from `router` to `$router`.

So now the recommended set up for your bindings in your routed component
is:

```js
{
  ...
  bindings: {
    $router: '<'
  }
}
```
2016-02-24 21:15:34 +00:00
Peter Bacon Darwin d4a4d81173 fix(angular1_router): support templateUrl components 2016-02-24 21:15:34 +00:00
laco0416 b634a25ae0 feat(core): Add `QueryList#forEach` 2016-02-19 19:23:46 -05:00
Julie Ralph c1a0af514f feat(test): add withProviders for per test providers
Closes #5128
2016-02-19 19:23:46 -05:00
Victor Berchet c6afea61f1 fix(DomRenderer): correctly handle namespaced attributes 2016-02-19 19:23:46 -05:00
Matias Niemelä b81b1fb81c revert: fix(change_detection): allow to destroy `OnPush` components inside of a host event
This reverts commit 280b86ec55.
2016-02-19 10:34:03 -08:00
Tobias Bosch 280b86ec55 fix(change_detection): allow to destroy `OnPush` components inside of a host event. 2016-02-18 17:54:24 -08:00
Jeff Cross 46d9c87ddc build(package): bump rxjs to 5.0.0-beta.2
Closes #7001
2016-02-17 16:28:50 -08:00
Matias Niemelä d736c31fea test(material): disable problematic e2e test
LGTM from Victor and Jeff in person :)
2016-02-17 16:18:33 -08:00
Alex Eagle a7e9bc97f6 ci(typescript): add typescript_next build
Install typescript@next before build.js and test.typings.
Restore the regular version before travis caches node_modules/.

Fixes #6368
2016-02-16 17:29:29 -08:00
Alex Eagle 265703b950 fix(typing): Remove re-export of the Promise built-in type.
Instead, ts2dart can add the 'dart:async' import whenever
Promise is used.

Fixes #6468
2016-02-12 20:45:41 -08:00
Alex Eagle ae275fa4e4 chore(ts2dart): update ts2dart to 0.7.24 2016-02-12 20:45:35 -08:00
Brandon Roberts 3478d5d450 fix(angular_1_router): Added DI string tokens
Closes #4269

Closes #7031
2016-02-12 21:15:34 +00:00
Brian Ford efb89b83e1 Revert "fix(DomRenderer): correctly handle namespaced attributes"
This reverts commit 61cf499b0b.
2016-02-11 13:44:16 -08:00
Brian Ford 3d96c2337f Revert "feat(svg): Provide support for SVG foreignObject by adding xhtml namespace"
This reverts commit eb688f2c8e.
2016-02-11 13:39:02 -08:00
Alex Eagle 3d715a2f7b fix(typings): publish es6 typings rather than postinstall.
Despite local testing, multiple users failed to run the postinstall to install typings.
Instead, we can distribute the typings we installed locally.

This is an alternative to #7003.
This also reverts rxjs to beta.1 since we have errors using beta.2, being addressed
in #7001.

Fixes #7000
2016-02-11 11:04:42 -08:00
Tim Blasi 1fd924f7d5 refactor(dart/transform): Simplify deferred rewriting
Simplify the DeferredRewriting and move package:quiver to a dev
dependency.

Closes #6994
2016-02-10 23:43:57 +00:00
Gion Kunz eb688f2c8e feat(svg): Provide support for SVG foreignObject by adding xhtml namespace
Closes #6192
2016-02-10 23:23:34 +00:00
Victor Berchet 61cf499b0b fix(DomRenderer): correctly handle namespaced attributes
Closes #6363
2016-02-10 22:34:13 +00:00
Alex Eagle f1f5b45361 feat(typings): install es6-shim typings to a location users can reference.
This makes the upgrade to beta.4 as simple as adding one reference tag, only when --target=es5
Implements option 3 from https://docs.google.com/document/d/1vgepQPkuHS4P3rzANQpoMIDIXe0Rl9Z2QyTtb8dpMoI/edit
2016-02-10 14:13:27 -08:00
vsavkin 50548fb565 fix(forms): use strict runtimeType checks instead of instanceof
Currently, validators extending built-in validators are treated as built-in.
This can result in an error when both a real built-in validator and a custom one are applied to the same element.

Closes #6981
2016-02-10 09:23:59 -08:00
vsavkin 8f47aa3530 fix(forms): add RadioButtonValueAccessor to the list of default value accessors 2016-02-09 15:28:08 -08:00
Brandon Roberts df7885c9f5 fix(router): Added route data to normalized async route
Closes #6802
2016-02-09 22:08:45 +00:00
Kara Erickson 0f10624b08 fix(ngFor): update view locals if identity changes
Closes #6923
2016-02-09 22:06:06 +00:00
David Reher 6f1ef33e32 fix(router): fix url path for star segment in path recognizer
Url path of star segments should equal the original path.

If you register the route `/app/*location` and invoke a url like `/app/foo/bar`
the PathRecognizer should return a url path equal to the invoked url.

Before this patch, everything after `foo` was ignored, which resulted in a
redirect to `/app/foo` which was probably not intended (at least in the angular
1.5 component router).

Closes #6976
2016-02-09 21:45:06 +00:00
vsavkin 231773ea76 fix(compiler): use event names for matching directives
Closes #6870
2016-02-09 13:16:08 -08:00
vsavkin e725542703 fix(forms): add support for radio buttons
Closes #6877
2016-02-09 19:47:50 +00:00
Fahimnur Alam 2337469753 style(angular1_router): license year updated
Closes #6219
2016-02-08 17:21:00 -08:00
Peter Bacon Darwin 55122cd57a fix(angular1-router): add missing wrapper methods
Closes #6763
Closes #6861
Closes #6861
2016-02-08 17:19:50 -08:00
Andrei Alecu 7e0f02f96e fix(upgrade): fix infinite $rootScope.$digest()
Fixes #6385
Closes #6386
2016-02-08 17:18:52 -08:00
Justin DuJardin e7ad03cba6 fix(core): add detail to dehydrated detector exception
- at least I know what component is causing the error with this. without it the exception is so generic that it's not useful.

Closes #6939
2016-02-08 17:17:37 -08:00
Sam Julien 74be3d3fde fix(core): mute mode printing in console in prod mode
Closes #6873
2016-02-08 17:16:19 -08:00
jennyraj a15ca23469 refactor(mock): update variable names in directive_resolver_mock.ts
Closes #5056
2016-02-08 17:11:43 -08:00
Tobias Bosch de77700da0 fix(di): throw if a token uses more than 20 dependencies.
Fixes #6690
Closes #6869
2016-02-08 16:21:57 -08:00
David Reher e73fee7156 fix(router): fixed the location wrapper for angular1
In angular2 `Location.path()` returns the complete path including query string. In angular1 the query parameters are missing. Similar to this `Location.go` does accept two parameters (path *and query*).

Closes #6943
2016-02-08 16:18:26 -08:00
Peter Bacon Darwin 72ab35bceb test(angular1_router): test that location handles query strings
See 6698
2016-02-08 16:18:13 -08:00
Peter Bacon Darwin 0f22dce036 feat(angular1_router): allow component to bind to router 2016-02-08 16:18:13 -08:00
Alexander Bachmann c6036435f0 fix(router): don't prepend `/` unnecessarily to Location paths
Closes #6729
Closes #5502
2016-02-08 16:18:13 -08:00
Peter Bacon Darwin d86be245b8 fix(angular1-router): add support for using the component helper
In Angular 1.5 there is a new helper method for creating component directives.
See https://docs.angularjs.org/guide/component for more information about components.

These kind of directives only match the `E` element form and the previously component
router only created HTML that matched directives that matched the `A` attribute form.

This commit changes the `<ng-outlet>` directive so that it generates custom HTML
elements rather divs with custom attributes to trigger the relevant component to
appear in the DOM.

Going forward, Angular 1.5 users are encouraged to create their router components
using the following style:

```
myModule.componnet('component-name', {
  // component definition object
});
```

Closes angular/angular.js#13860
Closes #6076
Closes #5278

BREAKING CHANGE:

The component router now creates custom element HTML rather than custom attribute
HTML, in order to create a new component. So rather than

```html
<div custom-component></div>
```

it now creates

```html
<custom-component></custom-component>
```

If you defined you router components using the `directive()` helper and
specified the `restrict` properties such that element matching was not allowed,
e.g. `restrict: 'A'` then these components will no longer be instantiated
by the component router and the outlet will be empty.

The fix is to include `E` in the `restrict` property.

`restrict: 'EA'`

Note that this does not affect directives that did not specify the `restrict`
property as the default for this property is already `EA`.
2016-02-08 16:18:13 -08:00
Kathy Walrath a26053d3ff docs(cheatsheet): fix Dart cheatsheet
Also deletes an extraneous period from the JS cheatsheet.

Closes #5936
2016-02-08 15:58:22 -08:00
Mike Ryan 24d5b665e1 docs(HostBindingMetadata): Removed brackets from host bindings in HostBindingsMetadata example
Closes #6941
2016-02-08 15:55:49 -08:00
Prayag Verma aa98fad338 docs: fix typo in 01_templates.md
Replace `an` with `a`

Closes #6842
2016-02-08 15:52:30 -08:00
Federico Caselli 9cb6dbbbab docs: fixed typo in documentation
Closes #6842
2016-02-08 15:30:15 -08:00
Brandon Roberts e21718faa9 docs(router): Updated inconsistencies in router docs
Closes #6805
2016-02-08 22:31:04 +00:00
Igor Minar b86829f492 revert: feat(transformers): collect information about di dependencies and providers
This reverts commit 86c40f8474.

Reason: new issues were discovered during the g3sync. @vsavkin is working on fixing them.
2016-02-08 12:15:03 -08:00
vsavkin 86c40f8474 feat(transformers): collect information about di dependencies and providers 2016-02-05 21:56:33 +00:00
Alex Eagle 2a70f4e4c7 fix(typings): Don't expose typing dependencies to users.
This resolves Duplicate Identifier issues seen by many users,
at the expense of more typings installation required in some
cases.

Removes the quickstart hack of placing all needed dependencies
typings files in our distribution. Removes dependencies on
nodejs from angular2/core.

Fixes #5973
Fixes #5807
Fixes #6266

Angular now depends on es6-promise and es6-collections
(and a handful of manual typings) rather than all of es6-shim.

Fixes #5242

We previously had an undocumented breaking change, this is now
documented in this commit.

Fixes #6817

BREAKING CHANGE:

Transitive typings are no longer included in the distribution.
You may need to install typings in your project using
http://github.com/typings/typings

Users now must rely on getting typings from:
- one of the peerDependencies, such as rxjs, which exposes
  typings via the moduleResolution=node mechanism.
  (see https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages)
  This happens automatically.
- Using --target ES5 now requires manual installation of
  es6-promise and es6-collections typings.
- Using some angular APIs may introduce a dependency on eg. nodejs
  or jasmine, and those typings need manual installation as well.

Closes #6267
2016-02-04 22:42:40 +00:00
Alex Eagle 2f31c4c1c5 chore(typings): use mainline DefinitelyTyped repo rather than a fork.
The upstream Jasmine typings don't define a type for the global
object with Jasmine methods polluting it, so just use any.

Also zone.js has a different name upstream.
2016-02-04 22:42:40 +00:00
Wesley Cho 9b0e10e9a7 fix(compiler): fix interpolation regexp
- Fix the interpolation regexp to match newline characters (i.e. `\n` and `\r`)

Closes #6056
2016-02-03 15:21:55 +00:00
Brian Yarger 995a9e0cf8 fix(router): fix incorrect url param value coercion of 1 to true
seriliazeParams is coercing a value of 1 to true, which causes the value to be completey dropped.
Change the test from double equals to triple equals to prevent this from happening.

Closes #5346

Closes #6286
2016-02-03 15:00:24 +00:00
gdi2290 b55f1764b5 fix(Headers): serializable toJSON
fixes #6073

Closes #6714
2016-02-03 14:03:01 +00:00
Scott Hatcher 5e9daed2e8 docs(http.ts): Fix MockBackend examples using backend.connections observer
Properly format observer examples.
2016-02-03 05:58:40 -08:00
Christoph Guttandin aa8c5aa2e2 docs(http): fix example usage of MockBackend 2016-02-03 05:57:08 -08:00
Jeff Cross f2c7946cca chore(http): make all typings explicit 2016-02-03 05:31:40 -08:00
Jason Teplitz da1fcfd820 fix(WebWorkers): Fix flaky WebWorker test
Closes #6851
2016-02-03 05:30:11 -08:00
Bryce Johnson dbeff6f548 style(ReflectionCapabilities) _zipTypesAndAnnotations, not _zipTypesAndAnnotaions
I was stepping through the Reflector and came across this little guy.

Closes #6535
2016-02-03 03:57:06 +00:00
Rob Wormald 26e60d658a fix(async): handle synchronous initial value in async pipe
Closes #5996
2016-02-03 03:56:52 +00:00
ericmartinezr c2ceb7fba4 fix(Validators): fix Validators.required marking number zero as invalid
Closes #6617
2016-02-03 03:34:42 +00:00
Shuhei Kagawa 4bfe49cd42 docs(core): update QueryList's onChange to changes.subscribe 2016-02-02 19:23:03 -08:00
Kara Erickson cee2318110 feat(ngFor): add custom trackBy function support
Make it possible to track items in iterables in custom ways (e.g. by ID or index), rather than simply by identity.

Closes #6779
2016-02-03 01:03:31 +00:00
Alex Eagle 3a40cd79f0 build(router): make the build.js script portable to g3 2016-02-02 13:58:51 -08:00
Brian Ford 6acc99729c build(router): refactor angular1 router build script 2016-02-02 13:58:51 -08:00
Pascal Precht 99e6500a2d feat(upgrade): support bindToController with binding definitions
Since angular 1.4 we can also pass controller bindings directly to bindToController, making this syntax more convenient

Closes #4784
2016-02-02 13:27:22 -08:00
Josh Olson 5c782d6ba8 Typo: Hash_consing wiki link wrong Markdown syntax 2016-02-02 11:53:30 -08:00
Brandon Roberts 4e43d6f769 docs(http): Added base request options for test example 2016-02-02 11:51:42 -08:00
Felix Itzenplitz 3529ee9973 docs(cheatsheet): change as to name in routing section 2016-02-02 11:43:29 -08:00
BeastCode 29aa6a6c1c change event to use camel case 2016-02-02 11:42:26 -08:00
Hongbo Miao e480b0798e docs: Kebab-case does not work. Change to camelCase.
Closes #6630
2016-02-01 15:15:46 -08:00
Misko Hevery 321193889f fix(zone): correct incorrect calls to zone 2016-02-01 21:53:42 +00:00
Julie Ralph a78dcfa5f3 chore(tests): fix broken linker integration test and fix DebugNode export
Fixes two small issues introduced with pr #6555
2016-01-29 14:29:49 -08:00
Julie Ralph e1bf3d33f8 feat(debug): replace DebugElement with new Debug DOM
Now, using `ng.probe(element)` in the browser console returns
a DebugElement when in dev mode.

`ComponentFixture#debugElement` also returns a new DebugElement.

Breaking Change:

This is a breaking change for unit tests. The API for the DebugElement
has changed. Now, there is a DebugElement or DebugNode for every node
in the DOM, not only nodes with an ElementRef. `componentViewChildren` is
removed, and `childNodes` is a list of ElementNodes corresponding to every
child in the DOM. `query` no longer takes a scope parameter, since
the entire rendered DOM is included in the `childNodes`.

Before:

```
componentFixture.debugElement.componentViewChildren[0];
```

After
```
// Depending on the DOM structure of your component, the
// index may have changed or the first component child
// may be a sub-child.
componentFixture.debugElement.children[0];
```

Before:

```
debugElement.query(By.css('div'), Scope.all());
```

After:

```
debugElement.query(By.css('div'));
```

Before:

```
componentFixture.debugElement.elementRef;
```

After:

```
componentFixture.elementRef;
```
2016-01-29 11:28:10 -08:00
mlaval ae7d2ab515 fix(bundle): add angular2/platform/testing/browser to SystemJS testing bundle 2016-01-29 13:58:06 +01:00
Tobias Bosch c6adbf602c fix(query): don’t cross component boundaries
Closes #6759
2016-01-28 23:38:40 +00:00
Tobias Bosch 1f7a41c963 fix(query): update view queries that query directives in embedded views
Fixes #6747
2016-01-28 14:40:53 -08:00
Marc Laval fc5b128b43 chore(ci): deflake test and turn on saucelabs_required
Fixes #6725

Closes #6733
2016-01-28 03:18:08 +00:00
Jason Teplitz c2a38c05aa fix(WebWorkers): Add support for transitionend events.
Closes #6649
2016-01-26 21:09:01 -08:00
Jason Teplitz 8bea667a0b feat(WebWorker): Add Router Support for WebWorker Apps
Closes #3563.
2016-01-26 21:07:12 -08:00
vsavkin 42231f5719 feat(change_detection): allow all legal programs in the dev mode
BEFORE:

The following would throw in the dev mode because `f` would return a new array when called by checkNoChanges.

@Component({
  template: `
    {{f()}}
  `
})
class A {
  f() { return [1]; }
}

AFTER:

The checkNoChanges function compares only primitives types for equality, and deeply compares iterables. Other objects cannot cause checkNoChanges to throw. This means that the dev mode would never fail given a legal program, but may allow some illegal programs.
2016-01-26 21:01:19 -08:00
Yegor Jbanov db87baeb98 fix(ddc): router, compiler, web worker fixes for DDC
Also enable DDC checks across all non-web worker playground apps. We are
now down to 2 DDC errors across all of them. The remaining two need to be
fixed in package:analyzer, not in angular.

BREAKING CHANGE:

- there's a chance of breakage as router's Instruction constructor
  signature changed.

Closes #6693
2016-01-27 02:30:20 +00:00
Tobias Bosch 0ae77753f3 fix(core): always remove DOM listeners and stream subscriptions
This is needed to prevent memory leaks. The DOM
listeners don’t need to be removed for simple examples,
but a big internal app shows memory leaks because of them.

BREAKING CHANGE:
- `Renderer.listen` now has to return a function that
  removes the event listener.
2016-01-26 07:37:31 -08:00
Yegor Jbanov 4282297c24 fix(ddc): type fixes necessary to bring DDC severe count to 0 2016-01-26 03:58:22 +00:00
Pawel Kozlowski 9c96b8affc chore: track size of a "Hello world" app built with SystemJS
Closes #6621
2016-01-26 02:54:03 +00:00
Tobias Bosch 132829e5e2 chore(core): deactivate the tests that use Dart isolates
These are broken with Dart 1.13.2 stable, and will soon be obsolete (see #6270).
2016-01-25 17:20:06 -08:00
Julie Ralph c72ed991ad fix(testing): remove test zone for now and rely on returned promises
Adds tests for public Dart and TS frameworks to make sure that
components with templateUrl can be created by the TestComponentBuilder.

Closes #6359

Closes #6601
2016-01-22 00:28:48 +00:00
Victor Berchet a24ee6add4 fix(HtmlLexer): fix for unicode chars
fixes #6036
Closes #6061
2016-01-21 23:45:41 +00:00
Jason Teplitz df3074fdfe feat(core/application_ref): Allow asyncronous app initializers.
closes #5929.

Closes #6063
2016-01-21 01:45:24 +00:00
Pawel Kozlowski f7424d5aeb chore: track size of a "Hello world" app built with WebPack
Closes #6434
2016-01-21 01:28:35 +00:00
Yegor Jbanov 761c6d0df7 fix(perf): faster looseIdentical implementation
Remove String type check in looseIdentical in JS-mode. It is not necessary as dart2js already compiles `identical` to `===` which compares string contents. Inline call sites.

This improves change detection of plain fields by 40%. On a large internal app the improvement is 5%.

Closes #6364
2016-01-21 01:01:36 +00:00
Jacob Richman 3e65d1458e fix(Dart): make some playground samples run with Dart Dev Compiler
Resolve all invalid field override errors, workaround current
reflection limitations in Dart Dev Compiler. todo, hello_world and
key_events samples now work with Dart Dev Compiler.

BREAKING CHANGE: remove TemplateRef.elementRef setter

Closes #6441
2016-01-21 00:41:42 +00:00
Victor Berchet a4b5cb8376 build(node): split test and src compilation units 2016-01-19 21:15:16 -08:00
Yegor Jbanov c785a1e474 fix(ddc): use dynamic types in reflection typedefs
Closes #6437
2016-01-19 21:49:11 +00:00
Lina Lu 9b3a548f6f docs(template_parser.ts): typo 2016-01-19 10:58:04 -08:00
Tim Blasi e19b31db29 refactor(test): Remove unnecessary `noSuchMethod`
Remove trivial implementations in many spy objects which just calls the
parent's `noSuchMethod`.

Closes #6410

Closes #6491
2016-01-15 22:53:09 +00:00
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