Commit Graph

5099 Commits

Author SHA1 Message Date
Alex Eagle 01111b04ff fix(ngc): codegen allows --strictNullChecks (#10991) 2016-08-22 15:30:18 -07:00
Alex Eagle 8560e1e4bf fix(ngc): comment out a private keyword in codegen. (#10949)
Workaround for b/30775898
2016-08-22 14:28:09 -07:00
Alex Eagle e0fbca9fb0 feat(ngc): support pathmapping using a separate reflector (#10985)
Until we have comprehensive E2E tests, it's too risky to change the
reflector_host Misko wrote before final. But google3 uses path mapping
and needs all imports to be  and all paths to be canonicalized to
the longest rootDir.

This change introduces a subclass of ReflectorHost with overrides for methods
that differ. After final (or when we have good tests), we'll refactor
them back into one class.
2016-08-22 11:48:33 -07:00
Kara ece7985b8a chore(formatting): fix formatting for component fixture spec (#10986) 2016-08-22 10:20:21 -07:00
Kara 9883e19e2e fix(tests): remove fit in component_fixture_spec (#10961) 2016-08-19 17:12:58 -07:00
Victor Savkin c631cfc2fd feat(core): add NO_ERRORS_SCHEMA that allows any properties to be set on any element (#10956)
Often it is useful to test a component without rendering certain directives/components
in its template because these directives require some complicated setup.

You can do that by using NO_ERRORS_SCHEMA.

TestBed.configureTestingModule({
  schemas: [NO_ERRORS_SCHEMA]
});

This would disable all schema checks in your tests.
2016-08-19 16:05:34 -07:00
Victor Savkin 53c99cfc95 feat(router): add syntax sugar for confuguring RouterTestingModule (#10906) 2016-08-19 16:01:59 -07:00
Victor Savkin c56f3f2246 fix(compiler): do not autoinclude components declared as entry points (#10898) 2016-08-19 15:59:50 -07:00
Brandon cc0e3d2296 docs(router): Added additional router documentation including cheatsheet updates (#10802) 2016-08-19 15:48:09 -07:00
Julie Ralph 917d43e108 refactor(tests): add ComponentFixture tests (#10910)
Remove old TestComponentBuilder tests, and keep relevant
ComponentFixture tests as component_fixture_spec.
2016-08-19 15:46:40 -07:00
Julie Ralph bb7d55244d fix(zones): bump zone version to 0.6.15 (#10953)
This fixes issues with microtasks being called too early
in certain tests.
2016-08-19 14:35:26 -07:00
Miško Hevery 8a5eb08672 fix(fakeAsync): have fakeAsync use Proxy zone. (#10797)
Closes #10503

It is possible for code in `beforeEach` to capture and fork a zone
(for example creating `NgZone` in `beforeEach`). Subsequently the code
in `it` may chose to do `fakeAsync`. The issue is that because the
code in `it` can use `NgZone` from the `beforeEach`. it effectively can
escape the `fakeAsync` zone. A solution is to run all of the test in
`ProxyZone` which allows a test to dynamically replace the rules at any
time. This allows the `beforeEach` to fork a zone, and then `it` to
retroactively became `fakeAsync` zone.
2016-08-19 12:10:53 -07:00
Alex Rickabaugh 477e425f57 fix(http): inline HTTP_PROVIDERS and JSONP_PROVIDERS until the metadata collector can do it automatically. (#10928) 2016-08-18 15:01:07 -07:00
Marcus Krahl 654ff6115a fix(http): deep copy for constructor using existing Headers (#10679)
When creating a new Headers object using an existing Headers object
the existing Headers map is copied by reference. Therefore adding a
new Header value to the new Headers object also added this value to
the existing Headers object which is not in accordance with the
spec.
This commit alters the constructor to create a deep copy of existing
Headers maps and therefore unlink existing Headers from new Headers.

Closes #6845

BREAKING CHANGE: 

any code which relies on the fact that a newly
created Headers object is referencing an existing Headers map is
now broken, but that should normally not be the case since this
behavior is not documented and not in accordance with the spec.
2016-08-18 15:00:44 -07:00
Alex Rickabaugh 628d06c17c feat(core): Throw a descriptive error when BrowserModule is installed a second time (via lazy loading). (#10899)
Such a configuration is unsupported and causes all kinds of problems.
2016-08-18 13:34:28 -07:00
John-David Dalton 91980382e8 fix(pipes): remove bidi control chars (#10870)
Fix inconsistent results in Edge vs. other browsers.

Closes #10080.
2016-08-18 13:31:33 -07:00
Chuck Jazdzewski 2f41b5c8a0 refactor(core): Removed test deprecated references from runtime_compiler (#10927)
Removed reference to TestComponentBuilder from runtime_compiler_spec.ts
2016-08-18 11:20:02 -07:00
Alex Eagle cd8cbd3762 fix(ngc): don't codegen foo.d.ngfactory.ts from foo.d.ts (#10833) 2016-08-18 10:11:06 -07:00
Kara 292ccf882a test(forms): update reactive form integration tests to use TestBed (#10908) 2016-08-17 17:10:56 -07:00
Alex Rickabaugh a0e13b9797 refactor(core): remove deprecated functions ReflectiveInjector.fromResolvedBindings and ResolvedReflectiveBinding (#10819) 2016-08-17 16:53:09 -07:00
Chuck Jazdzewski a5c0349d88 refactor(core): Removed linker test references to TestComponentBuilder (#10903)
Removed references to TestComponentBuilder from:
  query_integration_spec.ts
  regression_integration_spec.ts
  security_integration_spec.ts
  view_injector_integration_spec.ts
2016-08-17 16:52:39 -07:00
Jason Choi c48021ab97 refactor(compiler): move test/test_bindings to testing/test_bindings (#10081)
`test_bindings` is used in core test cases too, but `test` should be
private to the package, so it should live in `testing`.
2016-08-17 16:37:31 -07:00
Julie Ralph beb79e75bf refactor(various): remove a few lingering but unused deprecated apis (#10896)
Removes deprecated APPLICATION_COMMON_PROVIDERS, as well as some
internal apis that were deprecated.
2016-08-17 16:36:10 -07:00
Craig 0b62b6f783 refactor(debug): switch tests from TCB to use TestBed (#10756) 2016-08-17 16:27:54 -07:00
Craig 895c542a20 refactor(directiveLifecycle): switch test from TCB to use TestBed (#10768) 2016-08-17 16:17:07 -07:00
Alex Rickabaugh c4fd862e15 fix(metadata): throw better errors when components are passed to imports or modules are passed to declarations. (#10888)
Closes #10823
2016-08-17 15:57:02 -07:00
Chuck Jazdzewski 6f18bd18bb refactor(core): Removed linker test reference to TestComponentBuilder (#10867)
Removed TestComponentBuilder references from ng_container_integration_spect.ts
2016-08-17 15:45:29 -07:00
Victor Savkin 00e157dc3b refactor(router): update stability labels (#10902) 2016-08-17 15:35:30 -07:00
Victor Savkin 4be863c223 Remove TCB (#10900)
* refactor(webworker): change tests not to use TestComponentBuilder

* refactor(core): change tests not to use TestComponentBuilder
2016-08-17 15:05:22 -07:00
Martin Probst 3009be8d6e docs(security): mark the various DomAdapters as unsafe. (#10868)
Part of #8511.
2016-08-17 13:42:18 -07:00
Chuck Jazdzewski 4829fbb95c refactor(core): Remove linker test references to TestComponentBuilder (#10869)
Removed TestComponentBuilder references from projection_integration_spec.ts
2016-08-17 11:19:38 -07:00
Hans 40e160c22c fix(platform-browser-dynamic): Rename CACHED_TEMPLATE_PROVIDER to RESOURCE_CACHE_PROVIDER (#10866)
* fix(platform-browser-dynamic): Rename CACHED_TEMPLATE_PROVIDER to RESOURCE_CACHE_PROVIDER

Closes #9741

BREAKING CHANGE:

`CACHED_TEMPLATE_PROVIDER` is now renamed to `RESOURCE_CACHE_PROVIDER`

Before:

```js
import {CACHED_TEMPLATE_PROVIDER} from '@angular/platform-browser-dynamic';
```

After:

```js
import {RESOURCE_CACHE_PROVIDER} from '@angular/platform-browser-dynamic';
```

* Rename XHR -> ResourceLoader
2016-08-17 09:24:44 -07:00
vsavkin 9318033294 refactor(router): update router spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
vsavkin 4648b3e5de feat(testing): add TestBed.get 2016-08-17 08:06:32 -07:00
vsavkin 740e80492d refactor(core): update entry_components_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
vsavkin cc22b051e3 refactor(core): update change_detection_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
vsavkin 75405ae0f5 refactor(core): update forward_ref_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
Matias Niemelä f12d51992d fix(animations): report errors for missing host-level referenced animations (#10650)
Closes #10650
2016-08-17 08:00:49 -07:00
Kara 6fd5bc075d chore(forms): update forms labels (#10873) 2016-08-17 07:44:39 -07:00
Chuck Jazdzewski 675e582ffd refactor(http): Removed deprecated HTTP_PROVIDERS and JSONP_PROVIDERS (#10864)
BREAKING CHANGE: previously deprecated HTTP_PROVIDERS and JSONP_PROVIDERS were removed; see deprecation notice for migration instructions.
2016-08-17 07:43:31 -07:00
Chuck Jazdzewski 0a22e8eefd refactor(core): Removing linker test references to TestComponentBuilder (#10865)
Removed references to TestComponentBuilder from integration_spec.ts
2016-08-17 07:15:35 -07:00
Josh Thomas 44a4814766 Update package.json (#10609)
Update compiler-cli dependencies to increment tsc-wrapped to 0.2.2. It appears this was missed in the rc5 release.
2016-08-16 19:40:25 -07:00
Suguru Inatomi 3c23238129 docs(ngFor): add documentation for ngForTrackBy (#10780)
* docs(ngFor): add documentation for ngForTrackBy

* wo/ prefix
2016-08-16 19:39:22 -07:00
Trotyl Yu 2451eb9ded docs(router): Explanation in code should be comment (#10790) 2016-08-16 19:38:23 -07:00
Trotyl Yu ed639784d4 docs(router): Fix mismatching of code and comment (#10791) 2016-08-16 19:37:53 -07:00
Igor Minar 73a9ee4a05 Remove component resolver (#10858)
* refactor(core): remove deprecated ComponentResolver

BREAKING CHANGE: deprecated ComponentResolver was removed

Please follow deprecation instruction and migrate your code to use ComponentFactoryResolver.

* refactor(common): remove deprecated NgSwitchWhen directive

BREAKING CHANGE: previously deprecated NgSwitchWhen directive was removed, use NgSwitchCase instead
2016-08-16 16:48:32 -07:00
Matias Niemelä 9adf80385b fix(animations): remove deprecated trigger APIs (#10825)
BREAKING CHANGE: Animations defined using an at-symbol prefix that are
not property bound are now invalid.

```html
<!-- this is now invalid -->
<div @flip="flipState"></div>

<!-- change that to -->
<div [@flip]="flipState"></div>
```

BREAKING CHANGE: Animations that are not bound using the at-symbol
prefix using `animate-` must now be preixed using `bind-animate-`.

```html
<!-- this is now invalid -->
<div animate-flip="flipState"></div>

<!-- is valid now -->
<div bind-animate-flip="flipState"></div>
```

Closes #10825
2016-08-16 14:09:21 -07:00
Julie Ralph a86c554a8e refactor(core/testing): remove deprecated ViewMetadata (#10837)
Note that this doesn't actually remove all uses, but makes them
private.
2016-08-16 13:59:06 -07:00
Matias Niemelä 62078eee45 chore(tsconfig): emit decorator metadata so that tsc watch works with demos (#10863) 2016-08-16 13:53:04 -07:00
Victor Savkin 24e280a21a refactor(router): remove deprecated apis (#10658) 2016-08-16 13:40:28 -07:00
Victor Savkin f7ff6c5a12 refactor(core): remove deprecated 'bootstrap' (#10831) 2016-08-16 11:15:01 -07:00
Victor Berchet f6a7d6504c feat(i18n): xliff integration 2016-08-15 22:28:38 -07:00
Victor Berchet 96bf42261b fix(XmlHelper): declaration 2016-08-15 22:21:40 -07:00
Victor Berchet 72bb38f83b feat(i18n): xliff 2016-08-15 22:21:40 -07:00
Julie Ralph 4c9900dc3a refactor(testing): remove deprecated testing functions (#10832)
Remove TestComponentBuilder, addProviders, and withProviders. These
were deprecated in rc5 - see the changelog for update information.

Note - this does not actually remove the functions, but makes them
internal only. They will be removed from the codebase entirely
at a later time.
2016-08-15 21:40:37 -07:00
Victor Savkin 6b26102931 feat(router): extend support for lazy loading children (#10705) 2016-08-15 21:11:09 -07:00
Miško Hevery bec5c5fdad refactor(Provider): remove deprecated provider/bind API (#10652)
Closes #9751

BREAKING CHANGE:

These forms of providers are no longer accepted:
  bind(MyClass).toFactory(...)
  new Provider(MyClass, toFactory: ...)

We now only accept:
  {provider: MyClass, toFactory: ...}
2016-08-15 19:37:42 -07:00
Kara 04c11bb749 test(forms): update template-driven form tests to use testbed (#10830) 2016-08-15 16:37:59 -07:00
Igor Minar 3f5331be9d refactor(chore): remove deprecated NgZoneError (#10822)
BREAKING CHANGE: previously deprecated NgZoneError has been removed
2016-08-15 16:10:30 -07:00
Chuck Jazdzewski 48751cceae refactor(core): Removed deprecated Query and ViewQuery (#10820)
BREAKING CHANGE: previously deprecated Query and ViewQuery  were removed; see deprecation notice for migration instructions.
2016-08-15 16:07:55 -07:00
Chuck Jazdzewski 4a9745ef78 refactor(core): Remove deprecated DynamicComponentLoader (#10759)
BREAKING CHANGE: previously deprecated DynamicComponentLoader was removed; see deprecation notice for migration instructions.
2016-08-15 16:07:19 -07:00
Igor Minar acc0fe6cf9 refactor(TestBed): remove deprecated TestBed.reset 2016-08-15 14:07:54 -07:00
Igor Minar b238414984 refactor(core): remove previously deprecated SystemJsComponentResolver and SystemJsCmpFactoryResolver
BREAKING CHANGE: previously deprecated SystemJsComponentResolver and SystemJsCmpFactoryResolver have been removed.

Please follow deprecation instructions to migrate your code.
2016-08-15 14:07:54 -07:00
mgiambalvo 231ed69507 refactor(common): Remove uses of deprecated TestComponentBuilder. (#10754)
* ng_class_spec

* Working through ng_for_spec.

* Finishing up ng_for_spec.

* Finish the rest of the specs.

* Convert pipes tests.
2016-08-15 13:52:57 -07:00
Victor Savkin 60b10134df cleanup(platform): removed webworker and server deprecated apis (#10745) 2016-08-15 13:44:01 -07:00
Rob Wormald 73c0a9daaf fix(router): make routerLinkActiveOptions public (#10758) 2016-08-15 00:39:59 -07:00
Zhicheng Wang 398bbb6aa9 refactor(core): replace some `for` statements with map/reduce 2016-08-14 10:10:07 -07:00
Zhicheng Wang 05d1312306 refactor(core): Replace all `var` with `const` and `let` 2016-08-14 10:10:07 -07:00
Zhicheng Wang bc6d1c87a6 fix(core): don't strip sourceMappingURL (#9664)
fix #9664
2016-08-14 10:10:07 -07:00
Andrei Tserakhau 712c7d5c3b fix(datePipe): allow float for date pipe input (#10687) 2016-08-14 10:05:21 -07:00
Victor Berchet e9479b30e8 refactor(OutputAst): BuiltinMethod.bind renamed to Bind (#10739) 2016-08-14 10:04:37 -07:00
Kara 7f6685e451 test(forms): refactor form model tests to three files (#10774) 2016-08-13 17:26:08 -07:00
Victor Berchet ce4eae65a7 feat(i18n): provide LOCALE_ID and NgLocalization 2016-08-13 06:18:25 -07:00
Victor Berchet 4df48b202c fix(i18n): update NgLocalLocalization (#10771)
ref https://github.com/papandreou/node-cldr/issues/31
2016-08-13 05:43:36 -07:00
Igor Minar 33ced7088f refactor(common): remove deprecated ReplacePipe (#10772)
BREAKING CHANGE: previously deprecated ReplacePipe was removed
2016-08-12 21:50:57 -07:00
Igor Minar 3329977ec9 refactor(core): remove deprecated coreBootstrap and coreLoadAndBootstrap
BREAKING CHANGE: previously deprecated coreBootstrap and coreLoadAndBootstrap have been removed.

Please follow deprecation instructions to migrate your code.
2016-08-12 18:07:58 -07:00
Igor Minar f84c3fdc5f refactor(ApplicationRef): remove all previously deprecated ApplicationRef apis
BREAKING CHANGE: All previously deprecated ApplicationRef apis have been removed.

Please follow the deprecation instructions to migrate your code.
2016-08-12 17:59:30 -07:00
Igor Minar 44e1b23813 refactor(PlatformRef): remove deprecated PlatformRef#registerDisposeListener, #disposed, #dispose()
BREAKING CHANGE: previously deprecated PlatformRef#registerDisposeListener, #disposed, #dispose() - follow deprecation instructions to upgrade
2016-08-12 17:59:30 -07:00
Igor Minar 12b0a3d0e5 refactor(NgUpgrade): remove deprecated addProvider
BREAKING CHANGE: previously deprecated UpgradeAdapter#addProvider was removed, see deprecation notice for migration instructions.
2016-08-12 17:59:30 -07:00
Chuck Jazdzewski d2825077b1 fix(core): Removed depricated disposePlatform
BREAKING CHANGE: previously deprecated disposePlatform was removed; see deprecation notice for migration instructions.
2016-08-12 17:52:13 -07:00
Chuck Jazdzewski 156a52e390 refactor(core): Removed deprecated properties and events from metadata (#10753)
BREAKING CHANGE: previously deprecated DirectiveMetadataType#properties and DirectiveMetadataType#events were removed; see deprecation notice for migration instructions.
2016-08-12 17:44:44 -07:00
Chuck Jazdzewski bb7221f922 refactor(facade): Removed unnecessary override and deprecation. (#10761) 2016-08-12 17:41:12 -07:00
Chuck Jazdzewski 2eb4ee8393 refactor(core): Removed depricated lockRunMode (#10763)
BREAKING CHANGE: previously deprecated lockRunMode was removed; see deprecation notice for migration instructions.
2016-08-12 17:40:22 -07:00
Julie Ralph 87fe47737a fix(testing): override metadata subclasses properly (#10767)
This fixes an issue where `TestBed.overrideComponent(MyComp, {})`
would remove some properties including `providers` from the component.

This was due to the override not properly dealing with getter fields
on subclasses.
2016-08-12 17:39:33 -07:00
Alex Eagle 9317056138 fix(ngc): Revert "fix(ngc): add an option to produce TS1.9-pathMapping imports (#10602)" (#10765)
This reverts commit beadf6167a.
2016-08-12 17:38:29 -07:00
Chuck Jazdzewski a235ae16ed refactor(core): Removed deprecated DebugNode.inject() (#10751)
BREAKING CHANGE: previously deprecated DebugNode#inject was removed, see deprecation notice for migration instructions.
2016-08-12 15:57:23 -07:00
Kara 79afcf0766 fix(forms): remove deprecated form provider functions (#10741)
BREAKING CHANGE:

The deprecated `provideForms()` and `disableDeprecatedForms()` functions have been removed. Please import the `FormsModule` or the `ReactiveFormsModule` from @angular/forms instead.
2016-08-12 15:32:47 -07:00
Victor Berchet 161a4dd15f feat(i18n): Add NgLocaleLocalization which returns plural cases given a locale (#10744) 2016-08-12 14:46:06 -07:00
Matias Niemelä 6580d67875 feat(i18n): pass translation config directly into ngc (#10622) 2016-08-12 14:45:36 -07:00
Victor Savkin 04c6b2fe85 fix(router): location changes and redirects break the back button (#10742) 2016-08-12 14:30:51 -07:00
Suguru Inatomi 203b2ba637 fix(http): expose jsonpFactory for AoT compilation (#10730) 2016-08-12 11:30:12 -07:00
Marc Laval 6a011f4e8e test(security): work around an escaping bug in IE9 (#10493) 2016-08-12 10:34:55 -07:00
Kara 97f35714f7 feat(forms): add NgForm method that resets submit state (#10715) 2016-08-11 23:27:33 -07:00
PatrickJS 00e5b7d30a refactor(SharedStylesHost): remove SetWrapper facade (#10598) 2016-08-11 23:26:57 -07:00
Victor Berchet 39c0f9ebb3 fix(ExtractorMerger): returns errors together with nodes (as a ParseTreeResult) 2016-08-11 23:24:22 -07:00
Victor Berchet e60c765280 refactor: remove unused imports 2016-08-11 23:24:22 -07:00
Victor Berchet 91dd672aa4 style(xmb): add a space after ICU message cases 2016-08-11 23:24:22 -07:00
Victor Savkin cc6749c158 fix(router): lazy loading keeps refetching modules (#10707) 2016-08-11 22:59:53 -07:00
vsavkin f48142e679 feat(core): make ngprobe tokens pluggable 2016-08-11 22:56:10 -07:00
vsavkin 947f9c3f56 feat(router): make router.config public 2016-08-11 22:56:10 -07:00
Daniel Leib 7cd4741fcb fix(http): return empty string if no body is present (#10668) 2016-08-11 21:40:18 -07:00
Chuck Jazdzewski 2d520ae7e7 fix(compiler): Generate temporary variables for guarded expressions (#10657)
Fixes: #10639
2016-08-11 21:20:54 -07:00
Kara 5d59c6e80f docs(forms): fix reactive forms api examples (#10701) 2016-08-11 21:20:39 -07:00
Victor Berchet 50345b8c36 feat(i18n): add an HtmlParser decorator (#10645)
* fix(i18n): merge retains attributes w/o value

* feat(i18n): allow attributes on ng-container (i.e. i18n)

* feat(i18n): add an HtmlParser decorator

* style: clang format
2016-08-11 21:00:35 -07:00
Kara 7606c96c80 fix(forms): remove deprecated forms APIs (#10624)
BREAKING CHANGE:

The deprecated forms APIs in @angular/common have been removed. Please update to the new forms API in @angular/forms. See angular.io for more information.
2016-08-11 20:40:46 -07:00
vikerman 3466232f8b fix(build): Remove duplicate System declarations (#10713)
Add it to a common .d.ts. Prevents closure from complaining of duplicate declarations when compiled using tsickle to generate externs.
2016-08-11 19:37:01 -07:00
Alex Eagle 6e842fc5bf feat(ngc): allow ngc implementations to provide XHR (#10708) 2016-08-11 15:04:00 -07:00
Hans 50c795280f fix: use a global System.import() instead of using a property of the global facade (#10696) 2016-08-11 14:17:44 -07:00
Kara 2291929a15 feat(forms): add control status classes to form groups (#10667) 2016-08-11 09:01:09 -07:00
Alex Eagle 7fac4efede chore(facades): missed a couple places in #10620 (#10661)
This lets us skip src/facade/exception* when compiling modules other than core
2016-08-11 08:39:13 -07:00
Miško Hevery b96869afd2 refactor(Type): merge Type and ConcreType<?> into Type<?> (#10616)
Closes #9729

BREAKING CHANGE:

`Type` is now `Type<T>` which means that in most cases you have to
use `Type<any>` in place of `Type`.

We don't expect that any user applications use the `Type` type.
2016-08-10 18:21:28 -07:00
Alex Eagle 6f4ee6101c chore(imports): don't import ExceptionHandler from facade (#10620)
This lets us skip src/facade/exception* when compiling modules other than core.
It prevents having many conflicting declarations
2016-08-10 15:55:18 -07:00
Victor Savkin 6db27153ef Router Fixes (#10579)
* fix(router): copy over data during data resolution
* fix(router): components instantiated in lazy-loaded modules should use location's injector
2016-08-10 15:53:57 -07:00
Alex Eagle 9a11ec2624 fix(metadata): treat empty array of metadata like absent file (#10610) 2016-08-10 11:52:56 -07:00
Julie Ralph aff1bc9f2d refactor(tests): move public test APIs to TestBed (#10621)
Completely remove deprecated TestComponentBuilder and friends.
2016-08-10 11:51:40 -07:00
Victor Berchet 43512aa5eb fix(i18n): ICU placeholders are replaced by their translations (#10586)
They were replaced by the original message.
2016-08-09 21:05:04 -07:00
Victor Savkin c7f3aa71fb fix(router): support relative param-only navigation (#10613) 2016-08-09 17:03:17 -07:00
Misko Hevery f9da3c98d6 chore: remove deprecated router 2/2 2016-08-09 15:24:14 -07:00
Misko Hevery a20a420be6 chore: remove deprecated router 1/2 2016-08-09 15:24:14 -07:00
Alex Eagle beadf6167a fix(ngc): add an option to produce TS1.9-pathMapping imports (#10602)
This fixes a regression in #10486
2016-08-09 14:58:19 -07:00
Marc Laval c8da7e995f test(router): Android browser does not support element.click() 2016-08-09 13:25:20 -07:00
Marc Laval 8be6b12c2b test(router): use Object.isFrozen instead of relying on an exception 2016-08-09 13:25:20 -07:00
Marc Laval 4728f29f67 test(router): increase Karma timers and add polyfills for old browsers 2016-08-09 13:25:20 -07:00
vsavkin e3aa19049f chore(router): update changelog 2016-08-09 11:02:04 -07:00
vsavkin ef1eadadcd chore(router): bump up version number 2016-08-09 11:01:17 -07:00
Julie Ralph d75502eeee refactor(testing): remove deprecated test setup functions (#10600)
Remove test setup functions which were deprecated in rc5. See the
changelog for rc5 for how to update. In brief, instead of
`setBaseTestProviders`, use `TestBed.initTestEnvironment`.
2016-08-09 10:46:28 -07:00
Victor Berchet b65f66feff feat(i18n): switch to sha1 for message fingerprinting 2016-08-09 09:52:11 -07:00
Victor Berchet dd68ae3ef1 feat(ExtractorMerger): ignore implicit tags in translatable sections 2016-08-09 09:52:11 -07:00
Victor Berchet 1b04d70626 feat(ExtractorMerger): allow nested implicit tags 2016-08-09 09:52:11 -07:00
Matias Niemelä 0b08dd8674 chore(animations): make sure host-prop animation deprecation is correctly emitted
Closes #10581
2016-08-08 23:39:22 -07:00
Jesús Rodríguez b2b47177cd add brandon suggestions 2016-08-09 03:30:25 +02:00
Jesús Rodríguez f08257ff4a docs(cheatsheet): update for rc5 2016-08-09 03:06:01 +02:00
Igor Minar d1f4222c83 docs(cheatsheet): add NgModules docs to the cheatsheet 2016-08-08 17:18:50 -07:00
Igor Minar d21331e902 fix(ngUpgrade): to work with @NgModule
We changed the bootstrap order:
1. create NgZone
2. bootstrap ng1 inside NgZone and upgrade ng1 components to ng2 components.
3. bootstrap ng2 with NgZone

Note: Previous footgun behavior was: bootstrap ng2 first to extract NgZone, so that ng1 bootstrap can happen in NgZone. This meant that if ng2 bootstrap eagerly compiled a component which contained ng1 components, then we did not have complete metadata.
2016-08-08 12:50:08 -07:00
Igor Minar 37f138e83d test(ngUpgrade): convert the upgrade example to use NgModules
The example worked even before this change - verifying that the fallback/legacy mode works as well.
2016-08-08 12:20:22 -07:00
Igor Minar 5dab0bad3c test(NgUpgrade): add support for loading plaground/upgrade example without bundles 2016-08-08 12:20:22 -07:00
Igor Minar 85e70a4cde style(ngUpgrade): small cleanup 2016-08-08 12:20:21 -07:00
Igor Minar 6b564ecda5 feat(ngUpgrade): add support for NgModules
BREAKING CHANGE: UpgradeAdapter.addProvider are now deprecated in favor of passing in an NgModule into the adapter's constructor

Before:

```
let upgradeAdapter = new UpgradeAdapter();
upgradeAdapter.addProviders([myProvidersArray);
```

After:

```
@NgModule({
  providers: myProvidersArray
})
class MyModule {}

let upgradeAdapter = new UpgradeAdapter(MyModule);
```
2016-08-08 12:17:35 -07:00
Miško Hevery d4cceff0ef chore: remove module aware bootstrap API (#10543)
This API was introduced post RC4, but needs to be removed
before RC5 as we have decided against it.
2016-08-08 09:36:09 -07:00
vsavkin 1a41bd1ca4 feature(router): add route.root returning the root of router state 2016-08-08 09:15:59 -07:00
vsavkin 5a99393355 fix(router): route.parent should work for secondary children 2016-08-08 09:15:59 -07:00
vsavkin afcb3c0035 fix(router): support outlets in non-absolute positions 2016-08-08 09:15:59 -07:00
vsavkin d2d36c61f3 fix(router): fix matrix params check to handle 'special' objects 2016-08-08 09:15:59 -07:00
Damien Cassan 0bd97ecda2 feat(http): add options method to Http (#10540)
Add options method to the Http object, which could be useful when using self-describing RESTful APIs.

This closes #10500, closes #7918
2016-08-08 09:15:13 -07:00
Pawel Kozlowski 46bbcefb36 fix(linker): prevent pollution of empty embeddedView context (#10548)
Fixes #10045
2016-08-08 09:11:35 -07:00
Victor Berchet 74b57dfa7d refactor(i18n): remove circular dep 2016-08-05 13:39:54 -07:00
Victor Berchet 8c9c0986e9 refatcor(digestMessage): takes a `i18n.Message` 2016-08-05 13:39:54 -07:00
Victor Berchet 4028fcaa51 refactor(i18n): Drop `html.Message` and create `i18n.Message` right away 2016-08-05 13:39:54 -07:00
Victor Berchet 7a8ef1eae5 feat(i18n): merge translations 2016-08-05 13:39:54 -07:00
Victor Berchet e811a5d97f refactor(i18n): misc updates 2016-08-05 13:39:54 -07:00
Victor Berchet df44e3e425 fix(i18n extractor): array manipulation 2016-08-05 13:39:54 -07:00
Victor Berchet cdb1a237e5 refactor(compiler): html_parser -> ml_parser 2016-08-05 13:39:54 -07:00
Kara fcafdff10b feat(forms): allow both patching and strict setting of values (#10537) 2016-08-05 13:35:17 -07:00
vsavkin c586656d43 fix(router): fix type definition 2016-08-05 13:12:21 -07:00
vsavkin 3a307c2794 fix(router): absolute redirects should work with lazy loading 2016-08-05 13:12:21 -07:00
vsavkin 4f17dbc721 fix(router): add segmentPath to the link DSL 2016-08-05 13:12:21 -07:00
Jason Choi 99989f5d3f chore(facade): remove most facade/async functions 2016-08-05 12:26:28 -07:00
Jason Choi 6baf3baedd chore(playground): clang-format 2016-08-05 12:26:28 -07:00
Miško Hevery 0d1f3c3b07 fix: support trailing slash in basePath (#10533) 2016-08-05 11:11:24 -07:00
Jason Choi 83e2d3d1cb refactor(RegExpWrapper): remove the facade (#10512) 2016-08-05 09:50:49 -07:00
Victor Berchet b4613ab2d2 fix(ExpressionParser): undefined is undefined (was null) 2016-08-05 09:45:13 -07:00
Victor Berchet 0ca05eee45 feat(ExpressionParser): add support for `this` 2016-08-05 09:45:13 -07:00
Victor Berchet 26c9e1dc70 refactor(NgFor spec): code cleanup 2016-08-05 09:45:13 -07:00
Pawel Kozlowski 797cb5ae7b refactor(NgStyleSpec): simplify NgStyle tests (#10519) 2016-08-05 09:28:08 -07:00
Brandon 63b82cd730 feat(router): Allow navigation without updating the URL (#9608) 2016-08-04 11:46:09 -07:00
Patrice Chalin 2b704f0586 fix(linker/compiler): rename const to avoid duplicate declaration (#10457)
Currently in the `linker/compiler.ts` file, the **same identifier** is used in **two declarations**:
```typescript
export type CompilerOptions = { … }
…
export const CompilerOptions = new OpaqueToken('compilerOptions');
```
This breaks the API doc generation. I’m surprised that this was not flagged by the tsc.

The duplicate declaration was introduced in 46b212706b.
2016-08-04 11:31:58 -07:00
Pawel Kozlowski ce5ba80792 refactor(NgTemplateOutlet): simplify implementation (#10492) 2016-08-04 11:28:36 -07:00
Pawel Kozlowski 8b18ef4ba2 feat(NgStyle): add support for the style.unit notation (#10496)
Closes #10326
2016-08-04 11:00:43 -07:00
Marc Laval cd18de7a21 refactor(compiler): use Object.keys instead of Object.getOwnPropertyNames (#10498) 2016-08-04 10:35:41 -07:00
Jason Choi fd19671c07 chore(benchpress): clang-format and lint 2016-08-04 10:08:37 -07:00
Jason Choi 3fcd6fd93f chore(benchpress): make benchpress compile
Also adds compiling benchpress to the build scripts to verify that.
2016-08-04 10:08:37 -07:00
Alex Eagle c8d53d71a3 fix(ngc): gather metadata for OpaqueToken
Fixes #10482
2016-08-04 10:05:25 -07:00
Miško Hevery 790362e243 fix: put all `ngc` files into a single directory (#10486)
Prior to this change `ngc` would place generated files which refer
to components in the node_modules into the node_module. This is an
issue. Now all of the files are forced into a single directory
as specified in `tsconfig.json` by the `genDir` option.

see: https://docs.google.com/document/d/1OgP1RIpZ-lWUc4113J3w13HTDcW-1-0o7TuGz0tGx0g
2016-08-03 21:34:03 -07:00
Victor Savkin 2eda7a5293 fix(router): provideRouter should use provideRoutes (#10488) 2016-08-03 19:35:12 -07:00
Chuck Jazdzewski 9925aa89dc fix(compiler): Report references to non-exported symbols.
Includes fixes to places now reported as errors.

Part of #8310
2016-08-03 15:42:38 -07:00
Patrice Chalin 6195a45ae2 fix(forms): export AbstractFormGroupDirective
Because
- `Form` is **exported** -- see line 30/31 of
`modules/@angular/forms/src/forms.ts`: i.e., <br>`export {Form} from
'./directives/form_interface'`; and
- Methods of `Form`, which are public, have an
`AbstractFormGroupDirective` parameter;
e.g.,<br>`Form.getFormGroup(dir: AbstractFormGroupDirective):
FormGroup`.

Then it makes sense for `AbstractFormGroupDirective` to be
public/exported too. In any case, if it isn't exported then the **API
docs for `Form` don't get generated properly.**
2016-08-03 15:33:29 -07:00
vsavkin 422d380b3e feat(router): add queryParams and fragment to every activated route 2016-08-03 15:30:03 -07:00
vsavkin 550ab31bd0 feat(router): add parent, children, firstChild to ActivatedRoute 2016-08-03 15:30:03 -07:00
vsavkin 5fceb21549 refactor(router): remove dead code 2016-08-03 15:30:03 -07:00
vsavkin 29caa37943 feat(router): support sibling modules providing routes 2016-08-02 13:31:15 -07:00
Tobias Bosch 8efbcc996a fix(compiler): allow to use pipes inside of `*ngIf` (#10452)
Fixes #9746
2016-08-02 12:19:34 -07:00
Misko Hevery 91c64d2b8d fix: missing export for validators 2016-08-02 12:12:15 -07:00
Chuck Jazdzewski 82e7ecd611 fix(compiler): StaticReflect now resolves re-exported symbols (#10453)
Fixes: #10451
2016-08-02 11:45:14 -07:00
Tobias Bosch 3d53b33391 chore: update public api and integrate minor review comments 2016-08-02 11:23:26 -07:00
Tobias Bosch 34624b2db2 refactor(core): deprecate old methods on `ApplicationRef`
BREAKING CHANGE:
- `ApplicationRef.run` is deprecated. Use `NgZone.run` directly
- `ApplicationRef.injector` is deprecated. Inject an `Injector` or
  use `NgModuleRef.injector` instead
- `ApplicationRef.zone` is deprecated. Inject `NgZone` instead.
2016-08-02 11:23:26 -07:00
Tobias Bosch 1ab5eb0844 refactor(core): don’t use `zone.run` in `ApplicationRef.bootstrap`.
`ApplicationRef.bootstrap` is supposed to be run inside of `ngDoBootstrap` method
of the module that is bootstrapped, and that method already runs inside of the
zone.
2016-08-02 11:23:26 -07:00
Tobias Bosch 630028350a refactor(core): Introduce `AppInitStatus`
This class allows any provider to know and wait for the initialization of the
application. This functionality previously was tied to `ApplicationRef`.

BREAKING CHANGE:
- `ApplicationRef.waitForAsyncInitializers` is deprecated. Use 
  `AppInitStatus.donePromise` / `AppInitStatus.done` instead.
2016-08-02 11:23:26 -07:00
Tobias Bosch 7e4fd7d7da refactor(core): introduce `@NgModule.bootstrap` and `ngDoBootstrap` method
If a `@NgModule` has a `bootstrap` property, `PlatformRef.bootstrapModule` /
`PlatformRef.bootstrapModuleFactory` will automatically bootstrap the components
listed in there.
If such a property does not exist, `PlatformRef.bootstrapModule` /
`PlatformRef.bootstrapModuleFactory` will try to call the method `ngDoBootstrap(appRef: ApplicationRef)` on the module class.
Otherwise an error is reported.
2016-08-02 11:23:26 -07:00
Tobias Bosch af2e80e068 refactor(core): introduce `APP_BOOTSTRAP_LISTENER` multi provider
Using the `registerBootstrapListener` easily lead to race condition
and needed dependencies on `ApplicationRef`.

BREAKING CHANGE:
- `ApplicationRef.registerBootstrapListener` is deprecated. Provide a multi
  provider for the new token `APP_BOOTSTRAP_LISTENER` instead.
2016-08-02 11:23:26 -07:00
Tobias Bosch 8e6091de6c refactor(core): use `ngOnDestroy` in providers
Note about the addition of `beforeEach(fakeAsync(inject(…))))` in some tests:
`ApplicationRef` is now using `ngOnDestroy` and there is eager,
including all of its dependencies which contain `NgZone`.
The additional `fakeAsync` in `beforeEach` ensures that `NgZone`
uses the fake async zone as parent, and not the root zone.

BREAKING CHANGE (via deprecations):
- `ApplicationRef.dispose` is deprecated. Destroy the module that was
   created during bootstrap instead by calling `NgModuleRef.destroy`.
- `AplicationRef.registerDisposeListener` is deprecated.
   Use the `ngOnDestroy` lifecycle hook for providers or
   `NgModuleRef.onDestroy` instead.
- `disposePlatform` is deprecated. Use `destroyPlatform` instead.
- `PlatformRef.dipose()` is deprecated. Use `PlatformRef.destroy()`
   instead.
- `PlatformRef.registerDisposeListener` is deprecated. Use
  `PlatformRef.onDestroy` instead.
- `PlaformRef.diposed` is deprecated. Use `PlatformRef.destroyed`
  instead.
2016-08-02 11:23:26 -07:00
Tobias Bosch ecdaded25f feat(core): introduce `NgModuleRef.destroy` and call `ngOnDestroy` on all providers 2016-08-02 11:23:26 -07:00
Tobias Bosch c161ed415d feat(core): support `ngOnDestroy` on providers of a directive.
Such providers also become eager as they will be instantiated
anyways on destruction.
2016-08-02 11:23:26 -07:00
Tobias Bosch ff3b71f7b3 refactor(core): collect lifecycle hooks for all injectable classes 2016-08-02 11:23:26 -07:00
Tobias Bosch 16cc9b46aa fix(fake_async): share zone between `beforeEach` and `it`
This is needed for the case if a `beforeEach` instantiates
`NgZone`and the `it` uses
`TestComponentBuilder.createFakeAsync`.

Otherwise the `NgZone` will use the root zone as parent,
and `TestComponentBuilder.createFakeAsync` will always return
undefined as `tick` does not forward promises created
under the zone of `NgZone`.
2016-08-02 11:23:26 -07:00
Michael 3ce11ed58c docs(pipes): update I18nSelectPipe API documentation (#10449) 2016-08-02 10:59:07 -07:00
Marc Laval 7db75fa361 test: reactivate some of the disabled tests in Edge (#10450) 2016-08-02 10:58:03 -07:00
Kara d6d4568830 fix(forms): allow arrays as parents (#10440)
Closes #10432
2016-08-02 09:40:42 -07:00
Misko Hevery a55d796c4b fix: Better error message in case of unknown property binding 2016-08-02 09:28:04 -07:00
Misko Hevery 73f02c7861 fix: throw useful error on missing platform module. 2016-08-02 09:28:04 -07:00
Misko Hevery 8c8754e573 chore: add browserNoRouter test running mode 2016-08-02 09:28:04 -07:00
Sam Herrmann c977a906b3 docs(cheatsheet): add moduleId (#10095) 2016-08-02 07:34:04 -07:00
Kara e0eea6c2f4 feat(forms): add invalid prop to abstract controls (#10439) 2016-08-01 18:41:25 -07:00
vsavkin 3e377f520e fix(router): make an outlet to unregister itself when it is removed from the dom 2016-08-01 16:56:38 -07:00
vsavkin 8dc82a0080 fix(router): fix offline compilation by exporting provideLocationStrategy 2016-08-01 16:23:28 -07:00
vsavkin 4624a35845 docs(router): fixes api docs 2016-08-01 16:23:28 -07:00
Kara 8d4499959a feat(forms): add get method for easy access to child controls (#10428) 2016-08-01 14:22:50 -07:00
Victor Berchet 2dfc9c653b refactor: dart 2016-08-01 11:34:51 -07:00
Victor Berchet 106db0aba8 refactor: IS_DART === false 2016-08-01 11:34:51 -07:00
Victor Berchet 28c4852cd6 refactor: remove ts2dart annotations 2016-08-01 11:34:51 -07:00
Victor Berchet 13c8211065 fix: String.split(str, n) stops after n separator (#10408) 2016-08-01 11:33:35 -07:00
Victor Berchet e73d0511cf fix(TemplateParser): report empty expression (#10391)
fixes #3754
2016-08-01 11:24:49 -07:00
Matias Niemelä e18626b7a2 fix(core): ensure ngFor only inserts/moves/removes elements when necessary (#10287)
Closes #9960
Closes #7239
Closes #9672
Closes #9454
Closes #10287
2016-08-01 11:09:52 -07:00
Hans 4df7b1cfbc chore: fixes some issues that happen with closure compiler. (#10392) 2016-08-01 09:47:49 -07:00
Tobias Bosch 93ade740e2 fix(router): configure DI correctly when using the old `provideRouter` function 2016-08-01 02:35:41 -07:00
Tobias Bosch a46437c57d refactor(core): fix `bootstrapModule` regarding zones and initializers (#10383)
This makes `bootstrapModuleFactory` wait for promises
returned by `APP_INITIALIZER`s, also making `bootstrapModuleFactory` async.
I.e. now `bootstrapModule` and `bootstrapModuleFactory` behave in the
same way.

This ensures that all code from module instantiation, to creating
`ApplicationRef`s as well as calling `APP_INITIALIZERS` is run
in the Angular zone.

This also moves the invocation of the initializers from the `ApplicationRef`
constructor into the `bootstrapModuleFactory` call, allowing initializers
to get a hold of `ApplicationRef` (see #9101).

Fixes #9101
Fixes #10363
Fixes #10205
2016-08-01 02:12:59 -07:00
Tobias Bosch 633c7d1ebe refactor(core): cleanup unused `NgZone` factory
This factory was only used when using `coreBootstrap` / `coreLoadAndBoostrap`
which is not supported any more.
2016-08-01 02:12:59 -07:00
Cody-Nicholson 251953218c fix(http): URLSearchParams.clone propagate the QueryEncoder (#9900) 2016-07-30 19:01:20 -07:00
Suguru Inatomi 0d6cc17252 fix(UrlParser): stop setting default value 'true' (#10399) 2016-07-30 14:34:03 -07:00
Zhicheng Wang 6134320f16 refactor(http): rewrite for readable & efficient. 2016-07-29 21:30:28 -07:00
Zhicheng Wang 7f647822bd fix(http): headers should be case-insensitive.
fixes #9452

spec at https://tools.ietf.org/html/rfc2616
2016-07-29 21:30:15 -07:00
Victor Berchet e34a04d2ad feat(xmb/xtb): support dtd 2016-07-29 14:18:34 -07:00
Victor Berchet 44093905e2 refactor(test): refine types 2016-07-29 13:53:13 -07:00
Victor Berchet 3e2900f74b refactor(i18n): move code around 2016-07-29 13:40:58 -07:00
Victor Berchet 11fd2eccec refactor: fix merge glitches 2016-07-29 13:40:58 -07:00
Victor Berchet 0eee1d5de3 feat(i18n): xtb serializer 2016-07-29 13:40:58 -07:00
Victor Berchet 1b77604ee2 refactor(compiler): re-arrange files 2016-07-29 13:40:58 -07:00
Victor Berchet cc5cfe87c3 feat(i18n): xmb serializer 2016-07-29 13:40:58 -07:00
Victor Berchet 48f230a951 feat(I18nAst): introduce an intermediate AST 2016-07-29 13:40:58 -07:00
Victor Berchet 2be50bdbb0 refactor(i18n): message extractor
fixes #8802
2016-07-29 13:40:58 -07:00
Victor Berchet f7258ea52a test(HtmlAst): add a serializer 2016-07-29 13:40:58 -07:00
Victor Berchet 28e8b2faab feat(ICU): extract ICU messages 2016-07-29 13:40:58 -07:00
vsavkin 3c3e9ddb10 feat(router): add a validation to make sure pathMatch is set correctly 2016-07-29 12:27:43 -07:00
vsavkin 5162fb6d52 feat(router): add isActive to router 2016-07-29 12:27:43 -07:00
vsavkin 2fdb39e60a feat(router): activateroute should expose its route config 2016-07-29 12:27:43 -07:00
Marc Laval 43c71ae103 fix(platform-browser): IEMobile is badly detected when testing (#10382) 2016-07-29 10:05:12 -07:00
Marc Laval f0bd528d77 test(http): fix Blob creation for Android <= 4.3
Closes #10377
2016-07-29 18:20:09 +02:00
Marc Laval b48f7bcb8d fix(forms): normalize written value in NumberValueAccessor
Closes #10379
2016-07-29 18:18:30 +02:00
Chuck Jazdzewski 763ca60f5b feat(compiler): Support default parameters in static reflector (#10370)
Closes: #10369
2016-07-29 09:10:45 -07:00
Tobias Bosch d0a95e35af refactor(testing): introduce new testing api to support ng modules
BREAKING CHANGE:
- deprecations:
  * `withProviders`, use `TestBed.withModule` instead
  * `addProviders`, use `TestBed.configureTestingModule` instead
  * `TestComponentBuilder`, use `TestBed.configureTestModule` / `TestBed.override...` / `TestBed.createComponent` instead.

Closes #10354
2016-07-29 04:47:18 -07:00
Tobias Bosch acc6c8d0b7 feat(compiler): introduce `MockDirectiveResolver.setDirective` 2016-07-29 04:47:18 -07:00
Tobias Bosch 3dbc66c1ac refactor(core): introduce interfaces for constructor arguments of decorators
For @Directive, @Component, @Pipe, @NgModule
2016-07-29 04:47:18 -07:00
Tobias Bosch 4ad6bcce54 feat(compiler): add `MockPipeResolver` 2016-07-29 04:47:17 -07:00
Tobias Bosch 0988cc82b0 refactor(core): remove `ViewResolver` and `ViewResolverMock`
The methods on `ViewResolverMock` have been merged into `DirectiveResolver`.

BREAKING CHANGE:
- ES5 users can no longer use the `View(…)` function to provide `ViewMetadata`.
  This mirrors the removal of the `@View` decorator a while ago.
2016-07-29 04:47:17 -07:00
Chuck Jazdzewski 20b03bad11 feat(compiler): Added support for conditional expressions. (#10366)
Expression evaluated by the static reflector can now supports
conditional expressions.

Closes: #10365
2016-07-28 17:32:29 -07:00
vsavkin 81d27daf0d fix(router): update dts files 2016-07-28 15:03:19 -07:00
vsavkin bb8b82b3f5 fix(router): relax type defintion of Route to improve dev ergonomics 2016-07-28 15:03:19 -07:00
vsavkin 915a6666f8 fix(core): fix offline detection in ng_module_factory_loader 2016-07-28 15:03:19 -07:00
vsavkin 72da547d6a fix(router): updates router module to be offline-compilation friendly 2016-07-28 15:03:19 -07:00
Kara 7c76a75452 fix(forms): update dirty before emitting value change (#10362)
Closes #5328
2016-07-28 14:25:33 -07:00
Tobias Bosch a32c4ad2f0 fix(compiler): auto declare `entryComponents` recursively
Closes #10348
2016-07-28 12:03:34 -07:00
Tobias Bosch fb3608aa5d fix(compiler): report better error messages for `host` bindings
Closes #10346
2016-07-28 11:21:50 -07:00
Tobias Bosch 9b39e499ac fix(core): support components without a selector (#10331)
Components without a selector now get the selector `ng-component`.
Directives without a selector will throw an error message.

Closes #3464
Closes #10216
2016-07-28 10:39:10 -07:00
Hans a67cc8229d chore: move injector to being non-internal but private (#10339)
* chore: move injector to being non-internal but private

* Add the new non-internal method to the public API.
2016-07-28 10:38:29 -07:00
Chuck Jazdzewski b58e9ea775 feat(compiler): Added support for references to static fields. (#10334)
Closes: #10332
2016-07-27 19:26:59 -07:00
Rob Wormald 422effdd18 refactor(http): use ngModules for http (#10329) 2016-07-27 13:09:05 -07:00
vikerman 3b690b68a6 fix(testing): Fix error message in test bed
The API name in the error message was wrong
2016-07-27 12:03:27 -07:00
Kara 43349dd373 fix(forms): improve ngModel error messages (#10314) 2016-07-27 10:59:40 -07:00
Tobias Bosch e44e8668ea fix(core): only warn and auto declare undeclared `entryComponents`.
This is needed to support existing applications.
After final these warnings will become errors.

Closes #10316
2016-07-27 10:56:12 -07:00
Tobias Bosch 69e72c0786 chore: remove `browserDynamicTestingPlatform` as it is deprecated and was not part of rc.4
Closes #10319
2016-07-27 10:52:47 -07:00
Tobias Bosch 553344739c fix(core): allow module providers to overwrite providers from `ModuleWithProviders`
Fixes #10313
Closes #10317
2016-07-27 10:51:58 -07:00
Tobias Bosch 367f0fd142 fix(static_reflector): report methods with decorators in `propMetadata` as well
This was the behavior of our regular reflector as well, although the
method name does not imply this.

Fixes #10308
Closes #10318
2016-07-27 10:50:58 -07:00
Gabe Johnson 58d9e7fc5a feat(facade): add support for all thenables (#10278)
All objects that have a then function will be considered Promises
2016-07-27 10:37:48 -07:00
vsavkin 9d9e9c6ff1 refactor(router): take advantage of the new way of configuring modules 2016-07-27 10:24:29 -07:00
Matias Niemelä ba88db5141 fix(ngClass): do not deconstruct classes on element removal (#10303)
Prior to this fix [ngClass] would remove all dynamic classes
when destroyed. It's essential that classes are persisted such
that remove-based animations will still be stylistically correct.
This patch fixes this issue.

Closes #10008
Closes #10303
2016-07-26 15:20:27 -07:00
vsavkin 62e7c0f464 feat(router): implement canLoad 2016-07-26 14:39:02 -07:00
Tobias Bosch fc83bbbe98 fix(compiler): treat custom elements as unknown elements by default
Closes #10300
2016-07-26 12:31:22 -07:00
Martin Probst 482c019199 feat(security): only warn when actually sanitizing HTML. (#10272)
Previously, Angular would warn users when simply re-encoding text
outside of the ASCII range. While harmless, the log spam was annoying.

With this change, Angular specifically tracks whether anything was
stripped during sanitization, and only reports a warning if so.

Fixes #10206.
2016-07-26 11:39:09 -07:00
Chuck Jazdzewski b449467940 feat(compiler): Allow calls to simple static methods (#10289)
Closes: #10266
2016-07-26 10:18:35 -07:00
Kara 0aba42ae5b fix(forms): throw error if wrong control container for reactive forms (#10286) 2016-07-26 10:08:46 -07:00
Matias Niemelä 0d1bf8148b fix(animations): ensure animation detection doesn't rely on the body node
Closes #10230
Closes #10191
Closes #10273
2016-07-26 09:33:50 -07:00
Tobias Bosch b42411ba1f chore: update public api
- `precompile` -> `entryComponents`
- introduce `ModuleWithProviders`
- introduce `@NgModule.schema`
- update to bootstrap

Closes #10268
2016-07-26 07:45:40 -07:00
Tobias Bosch 5a21f168d6 refactor(core): change bootstrap of modules and names of platforms
BREAKING CHANGES:
- `browserPlatform`/`browserDynamicPlatform`/... have been deprecated and renamed into `platformBrowser`/`platformBrowserDynamic`/....
- `bootstrapModule` and `bootstrapModuleFactory` have been moved to be members of `PlaformRef`.
  E.g. `platformBrowserDynamic().bootstrapModule(MyModule)`.
2016-07-26 07:28:55 -07:00
Tobias Bosch 00b726f695 refactor(core): introduce `NgModule.schemas`
This allows Angular to error on unknown properties,
allowing applications that don’t use custom elements
to get better error reporting.

Part of #10043

BREAKING CHANGE:
- By default, Angular will error during parsing
  on unknown properties,
  even if they are on elements with a `-` in their name
  (aka custom elements). If you application is using
  custom elements, fill the new parameter `@NgModule.schemas`
  with the value `[CUSTOM_ELEMENTS_SCHEMA]`.

  E.g. for bootstrap:
  ```
  bootstrap(MyComponent, {schemas: [CUSTOM_ELEMENTS_SCHEMA]});
  ```
2016-07-26 07:04:36 -07:00
Tobias Bosch f02da4e91a feat(core): introduce `ModuleWithProviders`.
Modules can now provider helper functions that allow
to import a module together with an array of providers.

Part of #10043
2016-07-26 07:04:36 -07:00
Tobias Bosch d6b65db9a7 fix(static_reflector): resolve values of functions in the function context 2016-07-26 07:04:36 -07:00
Tobias Bosch 6f4e49ed53 refactor(core): rename `precompile` into `entryComponents`.
Part of #10043

BREAKING CHANGE:
- `@Component.precompile` was renamed to `@Component.entryComponents`
  (old property still works but is deprecated)
- `ANALYZE_FOR_PRECOMPILE` was renamed to `ANALYZE_FOR_ENTRY_COMPONENTS` (no deprecations)
2016-07-26 07:04:36 -07:00
Tobias Bosch 46b212706b refactor(core): change module semantics
This contains major changes to the compiler, bootstrap of the platforms
and test environment initialization.

Main part of #10043
Closes #10164

BREAKING CHANGE:
- Semantics and name of `@AppModule` (now `@NgModule`) changed quite a bit.
  This is actually not breaking as `@AppModules` were not part of rc.4.
  We will have detailed docs on `@NgModule` separately.
- `coreLoadAndBootstrap` and `coreBootstrap` can't be used any more (without migration support).
  Use `bootstrapModule` / `bootstrapModuleFactory` instead.
- All Components listed in routes have to be part of the `declarations` of an NgModule.
  Either directly on the bootstrap module / lazy loaded module, or in an NgModule imported by them.
2016-07-26 07:04:10 -07:00
Sammy Jelin 9edea0b139 fix(ng upgrade): do not compile ng2 components until after ng1 bootstrap (#10084)
Closes #9407 and angular/protractor#2944
2016-07-25 21:14:35 -07:00
vsavkin d15a1d64e1 fix(router): make router provides work with cli and offline compilation 2016-07-25 18:04:22 -07:00
Kara c87847974a chore(forms): separate out tests for reactive forms (#10283) 2016-07-25 15:57:51 -07:00
vsavkin 6f68330fa5 feat(router): rename UrlPathWithParams into UrlSegment
BREAKING CHANGE:

UrlPathWithParams => UrlSegment
UrlSegment => UrlSegmentGroup
2016-07-25 12:15:07 -07:00
vsavkin 2b63330a36 fix(router): handle when both primary and secondary are empty-path and primary has a child 2016-07-22 18:51:35 -07:00
vsavkin 06e4ca4bb3 fix(router): advance query params and fragment after advanced routes 2016-07-22 18:51:35 -07:00
vsavkin 43437c175a fix(router): handle url fragments when no url segments present 2016-07-22 18:51:35 -07:00
vsavkin 8d90a5a4cf fix(router): router link active should take all descendants into account 2016-07-22 18:51:35 -07:00
vsavkin 93a4ca652a refactor(router): renames PRIMARY_OUTLET into primary 2016-07-22 18:51:35 -07:00
Victor Berchet 41178367d1 feat(HtmlLexer): better hint on unclosed ICU message errors
fixes #10227
2016-07-22 17:27:15 -07:00
Victor Berchet 54f2edbb90 refactor(Lexer): code cleanup 2016-07-22 16:50:54 -07:00
Victor Berchet b652a7fc9f chore: remove obsolete files (#10240) 2016-07-22 16:18:31 -07:00
vikerman e34eb4520f fix(testing): ComponentFixture - Avoid extra scheduleMicrotask (#10223)
Don't schedule microtask to check for pending macrotasks when no one is waiting for a whenStable().
2016-07-22 16:07:11 -07:00
PatrickJS 190bcc89c1 refactor(EventEmitter): optional emits (#10058)
the Subject#next is optional
2016-07-22 10:19:57 -07:00
Jason Choi 64fc4648b7 fix(testing): correctly import NgMatchers (#10077)
Some test cases incorrectly rely on the side effect of other test cases
importing `NgMatchers`. This commit fixes this by making `expect` in
`core/testing_internal` properly typed.
2016-07-22 09:20:51 -07:00
Josh Gerdes bdb59129d0 feat(http): add content-type override support for http request (#10211) 2016-07-22 08:37:32 -07:00
Victor Berchet d455942389 fix(CurrencyPipe): use default Intl formatting options when none provided
fixes #10189
2016-07-22 08:21:31 -07:00
Martin Probst 51f3d22e4f feat(security): trust resource URLs as URLs. (#10220)
Resource URLs are strictly "more" trustworthy than plain URLs, so trusting them maintains the same level of security while avoiding to break people when we downgrade a resource URL context to a plain URL context.
2016-07-21 17:44:59 -07:00
Victor Berchet 00aa7a76b6 chore(tests): enable lint, make it green. (#10224) 2016-07-21 17:12:00 -07:00
vsavkin 27b87ef535 fix(router): throw when cannot parse a url 2016-07-21 16:14:55 -07:00
vsavkin 44709e0dca fix(router): handle urls with only secondary top-level segments 2016-07-21 16:14:44 -07:00
Victor Berchet 31a7709ece test: execute router tests on .`/test.sh browser` (#10053) 2016-07-21 16:12:40 -07:00
Martin Probst a441b5b8fe feat(security): categorize <track src> as a regular URL.
After security review, it turns out we were too paranoid about <track src>. Its content is not actually active or dangerous.

Fixes #10089.
2016-07-21 13:53:35 -07:00
Damien Cassan 76b8a49bfb feat(http): add support for blob as a response type (#10190) 2016-07-21 13:44:38 -07:00
vsavkin db54a84d14 fix(router): routerLinkActive should only set classes after the router has successfully navigated 2016-07-20 17:51:21 -07:00
vsavkin eb6ff65af7 refactor(router): makes an error message clearer 2016-07-20 14:47:51 -07:00
vsavkin 23ee29b6a2 fix(router): navigation should not preserve query params and fragment by default
BREAKING CHANGE

Previously both imperative (router.navigate) and declarative (routerLink) navigations
would preserve the current query params and fragment. This behavior turned out to
be confusing. This commit changes it.

Now, neither is preserved by default. To preserve them, you need to do the following:

router.naviage("newUrl", {preserveQueryParams: true, preserveFragment: true})

<a routerLink="newUrl" preserveQueryParams preserveFragment></a>
2016-07-20 14:30:04 -07:00
vsavkin 73a69895d8 cleanup(router): removes unnecessary files from tsconfig 2016-07-20 11:44:07 -07:00
vsavkin 2799e7a3ca refactor(router): rename RouterTestModule into RouterTestingModule 2016-07-20 11:39:31 -07:00
Julie Ralph b43f95435b fix(testing): add an explicit doAsyncPrecompilation step (#10015)
This removes the magic from the `inject` test helper that would inspect
the current zone and would only work with our `async` test helper.
Now, `inject` is always synchronous, and if you are using a module
that requires async precompilation, you're required to call
`doAsyncPrecompilation` in your tests.

This is part of the breaking changes introduced with the swap
to each test having an AppModule.

Closes #9975
Closes #9593

BREAKING CHANGE:

`TestInjector` is now renamed to `TestBed`

Before:

```js
import {TestInjector, getTestInjector} from '@angular/core/testing';
```

After:

```js
import {TestBed, getTestBed} from '@angular/core/testing';
```
2016-07-20 10:51:21 -07:00
Suguru Inatomi 450f61d384 docs(router): fix provider token (#10177) 2016-07-20 07:27:09 -07:00
Victor Berchet f3dd91e1d7 feat(NumberPipe): add string support (#10163)
fixes #10159
2016-07-19 11:27:06 -07:00
Julie Ralph 979946c062 fix(testing): Add platform directives to the shim that keeps setBaseTestProviders running (#10154)
Due to daa9da4047,
tests using the setBaseTestProviders stopped working with ambient directives such as
`ngIf`. Add them back in to keep the shim working.
2016-07-19 08:59:14 -07:00
vsavkin 51e661eb74 fix(router): export navigation extras 2016-07-18 17:42:04 -07:00
vsavkin 921a17960c fix(router): lazy loaded components should use loaded injector 2016-07-18 17:42:04 -07:00
vsavkin 7a4f6621ed fix(router): handle lastPathIndex of empty-path routes 2016-07-18 17:42:04 -07:00
Damien Cassan 83bc5c97ef fix(http): convert objects passed to requests into a string (#10124)
This remove a breaking change introduced with commit #e7a8e2757b06d572f614f53b648d2fd75df370d2 where json objects passed to  requests were not converted into string.

BREAKING CHANGE:

The behavior in this commit is the same as before PR 7260 : the objects sent with the request are converted to a string, therefore there is no need for the user to take care of the serialization.

Fixes #10073
2016-07-18 14:20:03 -07:00
Victor Berchet 3f08efa35d fix(KeyValueDiffer): check for changes
fixes #9115
2016-07-18 11:30:07 -07:00
Victor Berchet 0914dc35e8 refactor(Differ): cleanup 2016-07-18 11:30:07 -07:00
Victor Berchet b6746cce9c refactor(decorators): cleanup 2016-07-18 10:38:59 -07:00
Victor Berchet 8cd97c2054 refactor(NgFor): cleanup 2016-07-18 10:38:59 -07:00
Cole R Lawrence 32d8cde9c6 docs(NgSwitch): fix typo ngSwitch to NgSwitch (#10143) 2016-07-18 10:24:55 -07:00
vsavkin 1803ed2512 fix(router): fix rollup config to properly set up rxjs 2016-07-15 16:27:54 -07:00
vsavkin f08060b0b0 fix(router): back button does not work in IE11 and Safari 2016-07-15 14:59:59 -07:00
vsavkin b77a4a40a4 fix(router): expose initalNavigation and dispose so they can be used with webworkers 2016-07-14 17:29:01 -07:00
vsavkin e1109d52e1 docs(router): update the docs of LocationPathStrategy 2016-07-14 15:00:50 -07:00
vsavkin 0668ba50e8 fix(router): freeze params and queryParams to prevent common source of bugs 2016-07-14 13:33:05 -07:00
Hiroto Fukui aa88438b54 feat(Router): add extra validation for when route was passed as Array (#9942) 2016-07-14 08:28:31 -07:00
vsavkin 85be729c70 fix(router): lazily-loaded modules should use loaded injectors instead of the root one 2016-07-13 18:25:30 -07:00
vsavkin a5dc5705a3 feat(router): guards and data resolvers can now return promises 2016-07-13 18:25:30 -07:00
vsavkin 9e3d13f61f feat(router): add support for canActivateChild 2016-07-13 18:25:30 -07:00
Chuck Jazdzewski 961c9d48ae fix(compiler): Query expression lambdas should have dynamic type
Fixes: #9875
2016-07-13 15:41:30 -07:00
Chuck Jazdzewski 9229bbbc80 Revert "fix(compiler): Generates function expressions as returning any (#9980)"
This reverts commit eb5763c23f.
2016-07-13 15:41:30 -07:00
Kara 34feecf60e fix(forms): improve no value accessor error message (#10051) 2016-07-13 14:13:02 -07:00
Alex Eagle 4c762a6be3 chore(lint): enable lint check for duplicate vars 2016-07-13 12:33:39 -07:00
vsavkin 0426325ef7 fix(router): merge SystemJsAppModuleFactoryLoader and SystemJsAllModuleLoader 2016-07-13 11:16:46 -07:00
vsavkin 0b54e3cf0a fix(router): do not fire events on 'duplicate' location events 2016-07-13 11:16:46 -07:00
vsavkin 5cf58971f1 fix(router): update current state and url before activating components 2016-07-13 11:16:46 -07:00
Chuck Jazdzewski 6518ff88b2 fix(compiler): No longer writes 0 length files outside of genDir (#10023)
Fixes: #9984
2016-07-13 11:15:23 -07:00
Victor Berchet 42b0c1d8a2 refactor: misc cleanup (#10046) 2016-07-13 11:01:32 -07:00
Julie Ralph 4a965052f9 fix(platform-browser): remove testing_e2e target (#10029)
The testing_e2e util does not belong in platform-browser and was never
intended to be a public API. Move it out of that whole tree.

BREAKING CHANGE:

The following API was never intended to be public and is removed:

```js
import {verifyNoBrowserErrors} from '@angular/platform-browser/testing_e2e';
```

Consider using Protractor's console plugin: https://github.com/angular/protractor-console-plugin
2016-07-13 10:10:02 -07:00
nickraphael 5725c5925c docs(ExceptionHandler): Update code example in comment block to correct syntax error. (#10032) 2016-07-13 07:28:08 -07:00
choeller a46291b67c docs(router) Added @Injectable decorators to Router API examples (#10033) 2016-07-13 07:27:32 -07:00
Codebacca 4ac76ca281 docs(router): fix syntax in code example of comment block (#10026) 2016-07-13 07:26:26 -07:00
Damien Cassan e7a8e2757b refactor(http): share 'body' logic between Request and Response 2016-07-12 18:01:06 -07:00
Damien Cassan 1266460386 feat(http): add support for ArrayBuffer
Add the buffer option to store response in ArrayBuffer
Improve the interface to get back response independently of the buffer type
2016-07-12 18:01:06 -07:00
Victor Berchet 0ccb6e0dfc refactor: code cleanup 2016-07-12 16:57:39 -07:00
Victor Berchet 3050ae155c feat(ICU): enable ICU extraction even when when in is not used
BREAKING CHANGES:

"{" is used a a delimiter for ICU messages then it could not be used in text nodes.
"{" should be escaped as "{{ '{' }}"

Before:

    <span>some { valid } text</span>

After:

    <span>some { invalid } text<span> <!-- throw parse error -->
    <span>some {{ '{' }} valid } text</span>
2016-07-12 16:57:39 -07:00
Victor Berchet 402fd934d0 refactor: code cleanup 2016-07-12 15:26:03 -07:00
Victor Berchet 6c86e8d80a test(HtmlLexer): Add test for "{" and "{{" escaping 2016-07-12 15:26:03 -07:00
Victor Berchet 60e6f91a53 refactor(HmtlLexer): cleanup 2016-07-12 15:26:03 -07:00
Victor Berchet e676fded21 refactor(Lexer): add types
relates to #9100
2016-07-12 15:26:03 -07:00
Victor Berchet 25e070dd65 fix(HtmlParser): correctly propagate the interpolation config across layers 2016-07-12 15:26:03 -07:00
Kara da8eb9f8b8 feat(forms): add ability to reset forms (#9974)
Closes #4914
Closes #4933
2016-07-12 15:02:25 -07:00
Matias Niemelä 806a25413c feat(animations): allow animation integration support into host params
Closes #9044
Closes #9933
2016-07-12 14:55:36 -07:00
Matias Niemelä 5af1e891cd fix(animations): throw errors when duplicate component trigger names are registered 2016-07-12 14:55:31 -07:00
Matias Niemelä 79eda30f0f refactor(animations): collect parser / lookup errors in the same place 2016-07-12 14:55:27 -07:00
Victor Berchet 6d02d2f107 fix(SyncAsyncResult): fix default async value (#10013) 2016-07-12 13:55:06 -07:00
vsavkin ded518d47f feat(router): update routerLink DSL to handle aux routes 2016-07-12 11:44:55 -07:00
Victor Berchet 27436270fd fix(Compiler): Catch exceptions in the logging of binding update
fixes #9994
2016-07-12 11:21:32 -07:00
Andrei Tserakhau b4ea0b1601 test(datePipe): remove hardcoded timezone (#10007)
Closes #9964
2016-07-12 11:13:26 -07:00
Vikram Subramanian 7b31178546 fix(platform-browser-dynamic): Add @Injectable() annotation to XHRImpl.
Otherwise Closure compiled code will complain that the class is missing the annootation.
2016-07-11 23:27:35 -07:00
Vikram Subramanian 2ff83324af fix(core): Don't use ES6 spread operator when undefined is allowed.
Workaround a closure bug where it doesn't produce the right code ES6 operator when the array value can be undefined.
2016-07-11 23:14:25 -07:00
Chuck Jazdzewski 4ef86891a3 fix(compiler): Ignore references to declared modules and unneeded types (#9776)
Fixes: #9670
2016-07-11 17:26:35 -07:00
Chuck Jazdzewski eb5763c23f fix(compiler): Generates function expressions as returning any (#9980)
Function expressions are used in an expression context so untyped
function expressions should have any as the result type.

Fixes: #9877
2016-07-11 17:19:38 -07:00
Victor Berchet d1a3e3aff1 fix(DirectiveResolver): throw on duplicate Input & Output names 2016-07-11 16:38:06 -07:00
Victor Berchet 93d0a01d3d refactor: code cleanup 2016-07-11 16:22:23 -07:00
Julie Ralph 9af2d8b810 fix(testing): remove deprecated testing APIs (#9923)
See https://github.com/angular/angular/blob/master/CHANGELOG.md for
prior deprecation and how to update.
2016-07-11 16:04:32 -07:00
Victor Berchet 94dc632a6d fix(NgStyle): remove duplicate input declaration (#9978)
fixes #9977
2016-07-11 15:09:04 -07:00
Julie Ralph 29231877e6 fix(testing): reintroduce and deprecate setBaseTestProviders (#9905)
This change reverts the removal of setBaseTestProviders that was
introduced in 8d746e3f67.

Instead, setBaseTestProviders and the providers provided from
`@angular/platform-browser-dynamic/testing` and `@angular/server/testing`
will still work for the next release, but are deprecated.

See 8d746e3f67 for how to upgrade.
2016-07-11 14:01:11 -07:00
Kara e68252a79b fix(forms): re-enable form provider functions for easier migration (#9972) 2016-07-11 13:23:38 -07:00
Chuck Jazdzewski 4ec2a30942 fix(compiler): Fixed ?. operator to short-circut execution (#9965)
Fixes: #9850
2016-07-11 12:58:56 -07:00
Matias Niemelä a05f7b2d76 refactor(animations): move MockAnimationPlayer back into core (#9966)
Closes #9966
2016-07-11 10:55:47 -07:00
LongYinan 61e18434d3 refactor(router): not use reserved words as variable (#9941) 2016-07-11 10:53:29 -07:00
Victor Berchet 57473e72ec refactor: code cleanup (#9931) 2016-07-09 10:12:39 -07:00
Matias Niemelä c3bdd504d0 fix(animations): ensure all child elements are rendered before running animations
Closes #9402
Closes #9775
Closes #9887
2016-07-08 18:18:46 -07:00
Tobias Bosch daa9da4047 refactor(core): deprecate `coreBootstrap`, `PLATFORM_PIPES/DIRECTIVES` providers and `ComponentResolver`
BREAKING CHANGE (deprecations)

- Instead of `coreBootstrap`, create an `@AppModule` and use `bootstrapModule`.
- Instead of `coreLoadAndBootstarp`, create an `@AppModule` and use `bootstrapModuleFactory`.
- Instead of `bootstrapWorkerApp`, create an `@AppModule` that includes the `WorkerAppModule` and use `bootstrapModule` with the `workerAppPlatform()`.
- Instead of `bootstrapWorkerUi`, create an @AppModule that includes the `WorkerUiModule` and use `bootstrapModule` with the `workerUiPlatform()` instead.
- Instead of `serverBootstrap`, create an @AppModule and use `bootstrapModule` with the `serverDynamicPlatform()` instead.
- Instead of `PLATFORM_PIPES` and `PLATFORM_DIRECTIVES`, provide platform directives/pipes via an `@AppModule`.
- Instead of `ComponentResolver`:
  - use `ComponentFactoryResolver` together with `@AppModule.precompile`/`@Component.precompile` or `ANALYZE_FOR_PRECOMPILE` provider for dynamic component creation.
  - use `AppModuleFactoryLoader` for lazy loading.
- Instead of `SystemJsComponentResolver`, create an `@AppModule` and use `SystemJsAppModuleLoader`.
- Instead of `SystemJsCmpFactoryResolver`, create an `@AppModule` and use `SystemJsAppModuleFactoryLoader`

Closes #9726
2016-07-08 15:31:50 -07:00
vsavkin 245b0910ed feat(router): add activate and deactivate events to RouterOutlet 2016-07-08 15:01:52 -07:00
vsavkin a77db44129 feat(router): empty-path routes should inherit matrix params 2016-07-08 14:48:59 -07:00
vsavkin 34b3c534e7 fix(router): disallow root segments with matrix params 2016-07-08 14:47:55 -07:00
Tobias Bosch fa47890032 refactor(core): clean up platform bootstrap and initTestEnvironment
- Introduces `CompilerFactory` which can be part of a `PlatformRef`.
- Introduces `WorkerAppModule`, `WorkerUiModule`, `ServerModule`
- Introduces `serverDynamicPlatform` for applications using runtime compilation
  on the server.
- Changes browser bootstrap for runtime and offline compilation (see below for an example).
  * introduces `bootstrapModule` and `bootstrapModuleFactory` in `@angular/core`
  * introduces new `browserDynamicPlatform` in `@angular/platform-browser-dynamic
- Changes `initTestEnvironment` (which used to be `setBaseTestProviders`) to not take a compiler factory any more (see below for an example).

BREAKING CHANGE:

## Migration from `setBaseTestProviders` to `initTestEnvironment`:

- For the browser platform:
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;

  setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
  ```

  AFTER:
  ```
  import {initTestEnvironment} from ‘@angular/core/testing’;
  import {browserDynamicTestPlatform,
      BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;

  initTestEnvironment(
      BrowserDynamicTestModule,
      browserDynamicTestPlatform());

  ```
- For the server platform:
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;

  setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS);
  ```

  AFTER:
  ```
  import {initTestEnvironment} from ‘@angular/core/testing’;
  import {serverTestPlatform,
      ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;

  initTestEnvironment(
      ServerTestModule,
      serverTestPlatform());

  ```

## Bootstrap changes
```
@AppModule({
  modules: [BrowserModule],
  precompile: [MainComponent],
  providers: […], // additional providers
  directives: […], // additional platform directives
  pipes: […] // additional platform pipes
})
class MyModule {
  constructor(appRef: ApplicationRef) {
    appRef.bootstrap(MainComponent);
  }
}

// offline compile
import {browserPlatform} from ‘@angular/platform-browser’;
import {bootstrapModuleFactory} from ‘@angular/core’;

bootstrapModuleFactory(MyModuleNgFactory, browserPlatform());

// runtime compile long form
import {browserDynamicPlatform} from ‘@angular/platform-browser-dynamic’;
import {bootstrapModule} from ‘@angular/core’;

bootstrapModule(MyModule, browserDynamicPlatform());
```

Closes #9922
Part of #9726
2016-07-08 13:41:38 -07:00
Victor Berchet d84a43c828 fix(TemplateParser): add support for data-template attribute
fixes #9904
2016-07-08 13:07:01 -07:00
Victor Berchet 9a1babb30c refactor(TemplateParser): cleanup 2016-07-08 13:07:01 -07:00
Kara 30a332ee36 feat(forms): updateValue() for form groups and form arrays (#9901)
Closes #9553
2016-07-08 13:04:25 -07:00
Victor Berchet 2de8364de2 feat(ExpressionChangedAfterItHasBeenCheckedException): more meaningful error message
fixes #9882
2016-07-08 10:34:22 -07:00
Victor Berchet eacc9e6541 refactor: misc cleanup 2016-07-08 10:34:22 -07:00
Patrice Chalin 749dec7dfb doc(api): fix invalid doc links (#9873)
Errors were reported during API doc generation.
2016-07-07 23:02:35 -07:00
vsavkin 96a9e66616 feat(router): add the ANALYZE_FOR_PRECOMPILE provider to make dev ergonomics better 2016-07-07 18:07:10 -07:00
vsavkin 46e105f3ab fix(router): encode/decode params and path segments 2016-07-07 17:33:42 -07:00
vsavkin f7a0e9ecb6 fix(router): fix RouterLinKActive to work with RouterLink 2016-07-07 17:33:42 -07:00
Kara 93025d1bc6 fix(forms): export form directive arrays for offline compile (#9893) 2016-07-07 17:29:20 -07:00
Tobias Bosch 98d49d4ce3 refactor(core): make `lockRunMode` a noop and deprecate it.
BREAKING CHANGE:
- `lockRunMode` is deprecated and no more needed.

Closes #9878
2016-07-07 16:16:55 -07:00
Tobias Bosch 1426f680f5 refactor(core): add a deprecation message for using `PLATFORM_DIRECTIVES` / `PLATFORM_PIPES` / `CompilerConfig` / `XHR` as regular providers in `bootstrap`.
We still support this via a hack, but should remove this soon.

This also fixes tests for module directives / pipes
as they used directives / pipes that were
already present in the underlying platform.
2016-07-07 16:16:55 -07:00
Victor Berchet b7e69bc1a1 fix(NgPlural): expression inside cases (#9883)
fixes #9868
2016-07-07 14:47:06 -07:00
vsavkin 72544ba551 feat(router): add RouterTestModule 2016-07-07 14:28:01 -07:00
vsavkin c43dd5a655 refactor(router): renamed RouterAppModule into RouterModule 2016-07-07 14:28:01 -07:00
Matias Niemelä 7f4954bed6 fix(animations): change trigger binding syntax to function as a property binding []
Animation triggers can now be set via template bindings `[]`

BREAKING CHANGE:

animation trigger expressions within the template that are assigned as
an element attribute (e.g. `@prop`) are deprecated. Please use the
Angular2 property binding syntax (e.g. `[@prop]`) when assigning
properties.

```ts
// this is now deprecated
<div @trigger="expression"></div>

// do this instead
<div [@trigger]="expression"></div>
```
2016-07-07 14:13:06 -07:00
Matias Niemelä f1fc1dc669 revert: fix(animations): ensure all child elements are rendered before running animations
This reverts commit cbe85a0893.
2016-07-07 14:12:17 -07:00
Matias Niemelä cbe85a0893 fix(animations): ensure all child elements are rendered before running animations
Closes #9402
Closes #9775
2016-07-07 14:10:04 -07:00
Tobias Bosch 7073cf74fe feat(core): allow to add precompiled tokens via a provider
Introduces the new `ANALYZE_FOR_PRECOMPILE` token. This token can be used to
create a virtual provider that will populate the `precompile` fields of
components and app modules based on its
`useValue`. All components that are referenced in the `useValue`
value (either directly or in a nested array or map) will be added
to the `precompile` property.

closes #9874
related to #9726
2016-07-07 12:16:48 -07:00
Kara 9d265b6f61 feat(forms): add modules for forms and deprecatedForms (#9859)
Closes #9732

BREAKING CHANGE:

We have removed the deprecated form directives from the built-in platform directive list, so apps are not required to package forms with their app. This also makes forms friendly to offline compilation.

Instead, we have exposed three modules:

OLD API:
- `DeprecatedFormsModule`

NEW API:
- `FormsModule`
- `ReactiveFormsModule`

If you provide one of these modules, the default forms directives and providers from that module will be available to you app-wide.  Note: You can provide both the `FormsModule` and the `ReactiveFormsModule` together if you like, but they are fully-functional separately.

**Before:**
```ts
import {disableDeprecatedForms, provideForms} from @angular/forms;

bootstrap(App, [
   disableDeprecatedForms(),
   provideForms()
]);
```

**After:**

```ts
import {DeprecatedFormsModule} from @angular/common;

bootstrap(App, {modules: [DeprecatedFormsModule] });
```

-OR-

```ts
import {FormsModule} from @angular/forms;

bootstrap(App, {modules: [FormsModule] });
```

-OR-

```ts
import {ReactiveFormsModule} from @angular/forms;

bootstrap(App, {modules: [ReactiveFormsModule] });
```

You can also choose not to provide any forms module and run your app without forms.

Or you can choose not to provide any forms module *and* provide form directives at will.  This will allow you to use the deprecatedForms API for some components and not others.

```
import {FORM_DIRECTIVES, FORM_PROVIDERS} from @angular/forms;

@Component({
   selector: some-comp,
   directives: [FORM_DIRECTIVES],
   providers: [FORM_PROVIDERS]
})
class SomeComp
```
2016-07-07 11:32:51 -07:00
Roberto Simonetti 776a83f9da doc(i18nPluralPipe): update API doc example (#9862) 2016-07-07 08:48:37 -07:00
Andrei Tserakhau f29457f3f0 fix(datePipe): short timezone not displayed, closes #9812 (#9816) 2016-07-07 08:47:30 -07:00
Georgii Dolzhykov a005d1595e chore(compiler-cli): correct homepage URL in package.json (#9869) 2016-07-07 08:43:53 -07:00
Tobias Bosch 8d746e3f67 feat(testing): add implicit test module
Every test now has an implicit module. It can be configured via `configureModule` (from @angular/core/testing)
to add providers, directives, pipes, ...

The compiler now has to be configured separately via `configureCompiler` (from @angular/core/testing)
to add providers or define whether to use jit.

BREAKING CHANGE:
- Application providers can no longer inject compiler internals (i.e. everything
  from `@angular/compiler). Inject `Compiler` instead. This reflects the
  changes to `bootstrap` for module support (3f55aa609f).
- Compiler providers can no longer be added via `addProviders` / `withProviders`.
  Use the new method `configureCompiler` instead.
- Platform directives / pipes need to be provided via
  `configureModule` and can no longer be provided via the
  `PLATFORM_PIPES` / `PLATFORM_DIRECTIVES` tokens.
- `setBaseTestProviders()` was renamed into `initTestEnvironment` and 
  now takes a `PlatformRef` and a factory for a
  `Compiler`.
- E.g. for the browser platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
  
  setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);   
  ```

  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {browserTestCompiler, browserDynamicTestPlatform,
      BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      browserTestCompiler,
      browserDynamicTestPlatform(),
      BrowserDynamicTestModule);

  ```
- E.g. for the server platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
  
  setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS);   
  ```

  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {serverTestCompiler, serverTestPlatform,
      ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      serverTestCompiler,
      serverTestPlatform(),
      ServerTestModule);

  ```

Related to #9726
Closes #9846
2016-07-06 18:04:19 -07:00
vsavkin 37e6da6dfb refactor(router): clean up naming 2016-07-06 16:19:52 -07:00
vsavkin 8aa2a0c1b2 feat(router): add RouterAppModule 2016-07-06 16:00:40 -07:00
vsavkin 6bfd514caf fix(router): remove a circular dep 2016-07-06 14:38:05 -07:00
vsavkin 6fbe56dbf2 feat(router): update the example app to use lazily-loaded modules 2016-07-06 14:38:05 -07:00
vsavkin 8ebb8e44c8 feat(router): add support for lazily loaded modules 2016-07-06 14:38:05 -07:00
vsavkin 6fcf962fb5 feat(core): add AddModuleFactoryLoader 2016-07-06 14:38:05 -07:00
Patrice Chalin 2708ce6a17 docs(api): fix links (#9852) 2016-07-06 14:34:27 -07:00
Chuck Jazdzewski 30bec78da3 fix(compiler): Missing metadata files should result in undefined (#9704)
RelectorHost threw an exception when metadata was requested for a
.d.ts file that didn't have a .metadata.json file.  Changed it to
return undefined.

Fixes #9678
2016-07-06 14:26:31 -07:00
Chuck Jazdzewski 9a04fcd061 feat(compiler): Expression span information and error correction (#9772)
Added error correction so the parser always returns an AST
Added span information to the expression parser
Refactored the test to account for the difference in error reporting
Added tests for error corretion
Modified tests to validate the span information
2016-07-06 14:06:47 -07:00
Patrice Chalin ae62f082fd docs(api): fix broken example urls (#9828) 2016-07-06 13:57:38 -07:00
Matias Niemelä 9cc3b2ca9e fix(animations): ensure a null easing value is never used with web-animations
Closes #9780
Closes #9752
2016-07-06 11:25:54 -07:00
Matias Niemelä 3fe1cb0253 refactor(core): ensure CSS parser uses ParseSourceSpan to track ast locations
This commit also fixes up any remaining TODO comments.

Closes #9778
2016-07-06 11:22:45 -07:00
Tobias Bosch 3f55aa609f feat(browser): use AppModules for bootstrap in the browser
This introduces the `BrowserModule` to be used for long form
bootstrap and offline compile bootstrap:

```
@AppModule({
  modules: [BrowserModule],
  precompile: [MainComponent],
  providers: […], // additional providers
  directives: […], // additional platform directives
  pipes: […] // additional platform pipes
})
class MyModule {
  constructor(appRef: ApplicationRef) {
    appRef.bootstrap(MainComponent);
  }
}

// offline compile
import {bootstrapModuleFactory} from ‘@angular/platform-browser’;
bootstrapModuleFactory(MyModuleNgFactory);

// runtime compile long form
import {bootstrapModule} from ‘@angular/platform-browser-dynamic’;
bootstrapModule(MyModule);
```

The short form, `bootstrap(...)`, can now creates a module on the fly,
given `directives`, `pipes, `providers`, `precompile` and `modules`
properties.

Related changes:
- make `SanitizationService`, `SecurityContext` public in `@angular/core` so that the offline compiler can resolve the token
- move `AnimationDriver` to `platform-browser` and make it
  public so that the offline compiler can resolve the token

BREAKING CHANGES:
- short form bootstrap does no longer allow
  to inject compiler internals (i.e. everything 
  from `@angular/compiler). Inject `Compiler` instead.
  To provide custom providers for the compiler,
  create a custom compiler via `browserCompiler({providers: [...]})`
  and pass that into the `bootstrap` method.
2016-07-02 20:35:09 -07:00
Tobias Bosch 74b45dfbf8 Revert "refactor(core): ensure CSS parser uses ParseSourceSpan to track ast locations"
This reverts commit 5c9f871b21.
2016-07-01 21:21:56 -07:00
Matias Niemelä 5c9f871b21 refactor(core): ensure CSS parser uses ParseSourceSpan to track ast locations
This commit also fixes up any remaining TODO comments.

Closes #9285
2016-07-01 17:18:14 -07:00
Kara 77dc6ef411 fix(forms): mark control containers as touched when child controls are touched (#9735) 2016-07-01 15:36:04 -07:00
Andrei Tserakhau 5eca6e4e40 bug(datePipe): passing "hh" to the datepipe (#9774)
closes #9759
2016-07-01 15:34:57 -07:00
vsavkin 0c65d5cf2b fix(router): handle router outlets in ngIf 2016-06-30 22:14:42 -07:00
vsavkin f65ebec3ed fix(router): update links when query params change 2016-06-30 22:14:42 -07:00
vsavkin 81bf3f66ca docs(router): rename global redirects into absolute redirects 2016-06-30 22:14:42 -07:00
Rob Wormald 3cbded6694 fix(forms): use change event for select multiple (#9713) 2016-06-30 20:24:39 -07:00
PatrickJS 137fff9632 fix(router): remove private and internal annotations (#9753) 2016-06-30 19:39:13 -07:00
Kara 695c08b9dd test(forms): add test for multi-select and custom accessors (#9624) 2016-06-30 18:04:00 -07:00
Michael afb72164e4 fix(docs): typo in comments (#9743)
correct a typo in comments
2016-06-30 15:18:41 -07:00
vsavkin 01de58d650 chore(router): bump up version number 2016-06-30 14:58:59 -07:00
Rob Wormald dabf214f17 fix(router): remove private and internal annotations (#9745) 2016-06-30 14:47:55 -07:00
vsavkin fb2539e1d5 fix(router): remove the precompile warning 2016-06-30 14:33:04 -07:00
Tobias Bosch ad9f02a73e chore: enable cyclic dependency check
Closes #9742
2016-06-30 14:28:22 -07:00
Tobias Bosch 2d73583253 chore(compiler): fix cyclic dependency 2016-06-30 14:28:22 -07:00
Alex Eagle 73f017bad9 fix(typescript): make router compile with typescript@next
fixes #9731
2016-06-30 11:51:52 -07:00
vsavkin 055282f156 chore(router): bump up version number 2016-06-30 11:45:31 -07:00
vsavkin fe7de53b89 chore(router): update router change log 2016-06-30 11:45:31 -07:00
Tobias Bosch 17e4cfc748 feat(core): introduce `@AppModule`
Main part for #9726
Closes #9730
2016-06-30 11:34:40 -07:00
vsavkin a3b90411aa fix(router): fix RouterLinkActive to handle the case when the link has extra paths 2016-06-30 09:26:57 -07:00
vsavkin 5781b96490 fix(router): redirect should not add unnecessary brackets 2016-06-30 09:26:57 -07:00
vsavkin f208ee0d57 fix(router): reexport router directives 2016-06-30 09:26:57 -07:00
ipinak 8aa388de6c doc(directive): fixes incorrect example code (#9635) 2016-06-29 22:16:43 -07:00
Tobias Bosch 51d4c9dcbd fix(compiler): make code easier to type check
These changes are needed for the G3 sync as we use a different version/settings of Typescript than on Github.

closes #9701
2016-06-29 10:43:58 -07:00
Tobias Bosch e81dea695c fix(compiler): report not existing files as errors
Closes #9690
2016-06-29 07:35:34 -07:00
Miško Hevery 3fec27961e fix: support *directive on <template> (#9691)
fixes #7315
2016-06-28 21:53:41 -07:00
vsavkin 3784696b9e fix(router): make the contstructor of the router service public 2016-06-28 18:39:37 -07:00
vsavkin 8c45aebc18 fix(router): make router links work on non-a tags 2016-06-28 18:39:37 -07:00
Martin Probst 810c722413 docs(security): point users to docs when sanitization fails. (#9680) 2016-06-28 18:13:46 -07:00
Igor Minar e2116c53f3 fix(upgrade): add peerDependency on platform-browser-dynamic (#9674)
Closes #9623
2016-06-28 17:27:28 -07:00
vsavkin 296a447e3c docs(router): add api docs 2016-06-28 14:49:29 -07:00
Kara 0961bd1eff feat(forms): use formControlName on radio buttons when name is absent (#9681) 2016-06-28 15:21:53 -06:00
Naomi Black 9340e1b065 docs(security): security api doc update and fix stability marker for Type 2016-06-28 14:01:48 -07:00
Martin Probst 2d9d7f1310 fix(security): allow empty CSS values. (#9675) 2016-06-28 11:45:02 -07:00
Victor Berchet 5ee84fe0f6 refactor: add types (#9606)
relates to #9100
2016-06-28 11:35:59 -07:00
Jeff Cross 1620426393 fix(http): don't encode values that are allowed in query (#9651)
This implements a new class, QueryEncoder, that provides
methods for encoding keys and values of query parameter.
The encoder encodes with encodeURIComponent, and then
decodes a whitelist of allowed characters back to their
unencoded form.

BREAKING CHANGE:

The changes to Http's URLSearchParams serialization now 
prevent encoding of these characters inside query parameters
which were previously converted to percent-encoded values:

@ : $ , ; + ; ? /

The default encoding behavior can be overridden by extending
QueryEncoder, as documented in the URLSearchParams service.

Fixes #9348
2016-06-28 11:31:35 -07:00
Tobias Bosch bf598d6b8b feat(compiler): support sync runtime compile
Adds new abstraction `Compiler` with methods
`compileComponentAsync` and `compileComponentSync`.
This is in preparation of deprecating `ComponentResolver`.

`compileComponentSync` is able to compile components
synchronously given all components either have an inline
template or they have been compiled before.

Also changes `TestComponentBuilder.createSync` to
take a `Type` and use the new `compileComponentSync` method.

Also supports overriding the component metadata even if
the component has already been compiled.

Also fixes #7084 in a better way.

BREAKING CHANGE:
`TestComponentBuilder.createSync` now takes a component type
and throws if not all templates are either inlined
are compiled before via `createAsync`.

Closes #9594
2016-06-28 10:26:16 -07:00
Igor Minar 24eb8389d2 fix: public api surface fixes + stability markers
- ts-api-guardian will now error if a new public symbol is added with a stability marker (`@stable`, `@experimental`, `@deprecated`)
- DomEventsPlugin and KeyEventsPlugin were removed from public api surface - these classes is an implementation detail
- deprecated BROWSER_PROVIDERS was removed completely
- `@angular/compiler` was removed from the ts-api-guardian check since this package shouldn't contain anything that users need to directly import
- the rest of the api surface was conservatively marked as stable or experimental

BREAKING CHANGES: DomEventsPlugin and KeyEventsPlugin previously exported from core are no longer public - these classes are implementation detail.

Previously deprecated BROWSER_PROVIDERS was completely removed from platform-browser.

Closes #9236
Closes #9235
Ref #9234
2016-06-28 07:39:40 -07:00
vsavkin fcfddbf79c feat(router): add pathMatch property to replace terminal 2016-06-27 20:21:30 -07:00
vsavkin dc64e90ab9 feat(router): use componentFactoryResolver 2016-06-27 20:21:30 -07:00
vsavkin e12b1277df feat(core): split ChangeDetectorStrategy into ChangeDetectionStrategy and ChangeDetectorStatus 2016-06-27 20:19:20 -07:00
Kara 797914e948 fix(forms): emit statusChange when child controls have async validator (#9652) 2016-06-27 21:01:24 -06:00
Matias Niemelä e0b0a594bb fix(animations): ensure void => * animations are triggered when an expression is omitted
Closes #9327
Closes #9381
2016-06-27 18:55:10 -07:00
Kara ed0ade6f34 fix(forms): make radio button selection logic more flexible (#9646)
Closes #9558
2016-06-27 15:29:33 -06:00
Tobias Bosch 5cc7b41f39 Revert "fix(Compiler): relax childIsRecursive check (#8705)"
This fix prevented waiting for child components even if the cycle was only introduced via the `directives` array, i.e. without actually having a cycle. This easily causes issues for applications that have one shared list of directives for all components.

This reverts commit 3d5bb23184.

Closes #9647
2016-06-27 14:27:03 -07:00
vsavkin f2f1ec0117 feat(router): implement data and resolve 2016-06-27 14:25:56 -07:00
Alex Eagle e913d9954d chore(typings): restrict Angular to es5+collections+promise 2016-06-27 13:58:59 -07:00
vsavkin d20488752b fix(router): top-levels do not work in ngIf 2016-06-27 13:34:54 -07:00
vsavkin 855f3afb28 fix(router): canceled navigations should return a promise that is resolved with false 2016-06-27 13:34:54 -07:00
vsavkin 3f44377f2f fix(router): handle empty path with query params 2016-06-27 13:34:54 -07:00
vsavkin 90295e3252 fix(router): preserve fragment on initial load 2016-06-27 13:34:54 -07:00
Martin Probst db66509e66 test(security): tests for HTML5 elements, srcset.
Part of #9572.
2016-06-27 12:19:03 -07:00
Cyrille Tuzi 6605eb30e9 feat(security): allow more HTML5 elements and attributes in sanitizers
Allow more elements and attributes from the HTML5 spec which were stripped by the htmlSanitizer.

fixes #9438

feat(security): allow audio data URLs in urlSanitizer

test(security) : add test for valid audio data URL

feat(security): allow and sanitize srcset attributes

test(security): test for srcset sanitization
2016-06-27 12:19:03 -07:00
Gion Kunz 3644eef860 feat(DomRenderer): Adding support for document fragments in SVG foreign objects (#9458) 2016-06-27 08:26:45 -07:00
choeller eef9512ce6 fix(forms): async validator-directives process Observables correctly (#8186)
Closes #/8022
2016-06-26 16:52:50 -06:00
Marek Buko 9f00a1b902 fix(forms): add select multiple accessor as built-in accessor 2016-06-26 16:24:27 -06:00
Jesús Rodríguez c369bc747d docs: update cheatsheet import lines (#9614) 2016-06-26 07:31:35 -07:00
Kara Erickson c03e1f2f59 feat(forms): add support for formArrayName
Closes #9251
2016-06-25 13:30:53 -07:00
Kara Erickson 17dcbf66b9 feat(forms): expose ValidatorFn and AsyncValidatorFn
Closes #8834
2016-06-24 18:24:11 -07:00
Julie Ralph 40b907a657 refactor(testing): remove wrapping of Jasmine functions (#9564)
Instead, the async function now determines whether it should return a promise
or instead call a done function parameter. Importing Jasmine functions
from `@angular/core/testing` is no longer necessary and is now deprecated.

Additionally, beforeEachProviders is also deprecated, as it is specific
to the testing framework. Instead, use the new addProviders method directly.

Before:
```js
import {beforeEachProviders, it, describe, inject} from 'angular2/testing/core';

describe('my code', () => {
  beforeEachProviders(() => [MyService]);

  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```

After:
```js
import {addProviders, inject} from 'angular2/testing/core';

describe('my code', () => {
  beforeEach(() => {
    addProviders([MyService]);
  });

  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
2016-06-24 17:48:35 -07:00
Julie Ralph a33195dcf3 fix(core/testing compiler/testing): move TestComponentBuilder to core/testing (#9590)
TestComponentBuilder now lives in core/testing. compiler/testing contains a private
OverridingTestComponentBuilder implementation which handles the private behavior
we need to override templates. This is part of the effort to simplify the testing
imports and hide compiler APIs.

Closes #9585

BREAKING CHANGE:

`TestComponentBuilder` is now imported from `@angular/core/testing`. Imports
from `@angular/compiler/testing` are deprecated.

Before:

```
import {TestComponentBuilder, TestComponentRenderer, ComponentFixtureAutoDetect} from '@angular/compiler/testing';
```

After:
```
import {TestComponentBuilder, TestComponentRenderer, ComponentFixtureAutoDetect} from '@angular/core/testing';
```
2016-06-24 17:35:01 -07:00
Kara Erickson de127109f9 feat(forms): make valueChanges and statusChanges available on abstract control directives 2016-06-24 14:37:19 -07:00
vsavkin 83208983b3 chore(router): bump up version number 2016-06-24 13:07:42 -07:00
vsavkin 327d04c9c6 chore(router): clang-format 2016-06-24 12:44:32 -07:00
vsavkin 54edce2bab fix(router): wildcard don't get notified on url changes 2016-06-24 12:44:32 -07:00
vsavkin 1a145ac500 fix(router): default exact to false in routerLinkActiveOptions 2016-06-24 12:44:32 -07:00
vsavkin 9f978cf49d test(router): add a test checking that you can use a slash in query params 2016-06-24 12:44:32 -07:00
vsavkin 41b781107b fix(router): doen't throw on canDeactive when route hasn't advanced 2016-06-24 12:44:32 -07:00
Julie Ralph dcf75126bf fix(common/testing): remove internal MockLocationStrategy from common/testing (#9562)
BREAKING CHANGE:

MockLocationStrategy was intended to be internal only and is now removed
from the `@angular/common/testing` public api.

Use `SpyLocation` from `@angular/common/testing` for location testing.
2016-06-24 12:41:57 -07:00
Julie Ralph 1143b0389a fix(core/testing): move ComponentFixture to core (#9386)
BREAKING CHANGE:

`ComponentFixture` will be moving out of `@angular/compiler/testing` to `@angular/core/testing` in
this release. For now, it is deprecated from `@angular/compiler/testing`.
2016-06-24 12:41:49 -07:00
Kara Erickson 97a2119596 fix(forms): ngModel should emit valueChanges and statusChanges asynchronously 2016-06-24 12:37:46 -07:00
vsavkin fbd2dd9ca2 fix(router): handle path:'' redirects and matches 2016-06-24 11:39:41 -07:00
Julie Ralph 8a9e9c7bd3 fix(core/testing): clean up the core testing public API (#9466)
Previously, we were exporting internal mocks and helpers. Move these
to core/testing/testing_internal or remove them if they were
never used.

Remove deprecated items - injectAsync, clearPendingTimers.

BREAKING CHANGE:

Remove the following APIs from `@angular/core/testing`, which have been deprecated or were
never intended to be publicly exported:

```
injectAsync
clearPendingTimers
Log
MockAppliacationHref
MockNgZone
clearPendingTimers
getTypeOf
instantiateType
```

Instead of `injectAsync`, use `async(inject())`.

`clearPendingTimers` is no longer required.
2016-06-23 17:10:22 -07:00
Julie Ralph 3d8eb8cbca fix(platform-browser/testing): clean up public api for platform-browser/testing (#9519)
Mostly, removing things that were never intended to be exported publicy.

BREAKING CHANGE:

The following are no longer publicly exported APIs. They were intended as internal
utilities and you should use your own util:

```
browserDetection,
dispatchEvent,
el,
normalizeCSS,
stringifyElement,
expect (and custom matchers for Jasmine)
```
2016-06-23 16:42:25 -07:00
Julie Ralph 894747c34c fix(platform-browser/testing-e2e): clean up unused exports from e2e testing helpers (#9387) 2016-06-23 16:14:31 -07:00
Julie Ralph 8d5a312585 chore(api): clean up compiler/testing api (#9520)
Do not export MockXHR, which is a private helper.
2016-06-23 15:52:18 -07:00
Jason Choi 22d8f73bc9 test: add public api golden files
Includes a few style fixes on "* as foo" imports.
2016-06-23 14:26:40 -07:00
Martin Probst 3ad81b1beb test(security): simplify integration test. 2016-06-23 13:57:51 -07:00
Martin Probst 5ab0534164 test(security): Ensure xlink:href is not bindable.
The DOM schema does not allow binding any properties to dangerous SVG
attributes/properties. This change adds a smoke test to verify that
behaviour, by testing that `xlink:href` (a sample dangerous property)
is not bindable.

Fixes #9510.
2016-06-23 13:57:51 -07:00
Igor Minar 5150344213 fix(common): add license header to localization.ts 2016-06-23 13:27:43 -07:00
Wojciech Kwiatek 98cef76931 fix(security): no warning when sanitizing escaped html (#9392) (#9413) 2016-06-23 13:06:19 -07:00
Tobias Bosch 6c5b653593 feat(core): add `@Component.precompile` and `ComponentFactoryResolver`
Part to #9467
Closes #9543
2016-06-23 12:10:04 -07:00
Tobias Bosch 9ed8f2d26e fix(compiler): don't inject `viewProviders` into content child elements
E.g. in the following scenario,
`some-directive` should not be able to inject
any view provider that `my-comp-with-view-providers`
declares.

```
<my-comp-with-view-providers>
  <div some-directive></div>
</my-comp-with-view-providers>
```
2016-06-23 12:10:04 -07:00
Tobias Bosch 33a2f86b28 chore: remove stale tsconfig.json
This tsconfig.json prevents fast round trip cycles in VsCode
as it relies on the package-dist folders to be filled.
2016-06-23 12:10:04 -07:00
Victor Berchet fed1672a43 refactor(i18n): I18nPipe uses NgLocalization (#9313)
and some refactoring
2016-06-23 11:44:05 -07:00
Pawel Kozlowski df759b8d4b fix(core): improve error message for broken bindings
Fixes #6820

Closes #9536
2016-06-23 19:28:56 +02:00
Kara Erickson 6edf0474cc feat(forms): add support for standalone ngModel dirs inside forms
Closes #9230
2016-06-23 10:16:47 -07:00
Josh Thomas 826f89f862 fix(ngc): correct dependencies for compiler-cli
Update compiler-cli dependencies to include minimist and also increment tsc-wrapped to 0.2.0.  There is signature mismatch between tsc-wrapped (v0.1.0) collector.js#getMetadata and compiler-cli reflector_host.js#getMetadataFor that caused an error anytime ngc was executed. The error received was as follows.

`TypeError: Cannot read property 'getSymbolsInScope' of undefined`

After forcing NPM to install @angular/tsc-wrapped@latest the error was resolved.

Fixes #9540
2016-06-23 10:16:04 -07:00
Matias Niemelä c43aec2182 fix(animations): make sure the easing value is passed into the web-animations player
Closes #9517
Closes #9523
2016-06-23 10:14:18 -07:00
ScottSWu ae75e3640a chore(lint): Added license headers to most TypeScript files
Relates to #9380
2016-06-23 09:47:54 -07:00
Victor Berchet e1e5c40ef7 fix(testing): remove the `toThrowErrorWith` matcher (jasmine has `toThrowError`)
BREAKING CHANGE:

Before:

    expect(...).toThrowErrorWith(msg);

After:

    expect(...).toThrowError(msg);
2016-06-23 08:58:52 -07:00
Victor Berchet 6420f75320 fix(testing): remove the `toMatchPattern` matcher (jasmine has `toMatch`)
BREAKING CHANGE:

Before:

    expect(...).toMatchPattern(pattern);

After:

    expect(...).toMatch(pattern);
2016-06-23 08:58:28 -07:00
Victor Berchet 5face35ae5 refactor: misc cleanup 2016-06-23 08:56:10 -07:00
Victor Berchet 398060d5ff fix(NgSwitch): display deprecation message only once 2016-06-23 08:56:10 -07:00
Torgeir Helgevold 638fd744aa feat(forms): support updating of validators on exiting controls (#9516)
lint

fix

async

d

test

test
2016-06-23 08:18:07 -07:00
Pawel Kozlowski 098b461b69 fix(core): report duplicate template bindings in templates
Fixes #7315

BREAKING CHANGES:

Previously multiple template bindings on one element
(ex. `<div *ngIf='..' *ngFor='...'>`) were allowed but most of the time
were leading to undesired result. It is possible that a small number
of applications will see template parse errors that shuld be fixed by
nesting elements or using `<template>` tags explicitly.

Closes #9462
2016-06-23 15:59:07 +02:00
Dmitry Zamula a5f2e205ef fix(http): add search param escaping for keys (#9166) 2016-06-22 18:23:15 -07:00
ScottSWu 8899b83927 chore(typescript): Enabled noFallthroughCasesInSwitch
Turned on the noFallthroughCasesInSwitch flag in tsconfig and fixed
a few cases where there were fallthroughs.
2016-06-22 16:08:55 -07:00
Victor Berchet f6a410a4a8 feat(QueryList): implement some() (#9464)
closes #9443
2016-06-22 13:13:31 -07:00
tycho01 3d5bb23184 fix(Compiler): relax childIsRecursive check (#8705)
Fix how the compiler checks for recursive components by also considering
component descendants. Previously, it only checked if the current
component was evaluated previously. This failed in certain cases of
mutually recursive components, causing `createAsync` in tests to not
resolve.

closes [7084](https://github.com/angular/angular/issues/7084)
2016-06-22 07:02:11 -07:00
vsavkin ef37d2ae0b example(router): add an example app for the new router 2016-06-21 23:19:26 -07:00
vsavkin 758ee95880 fix(router): fix tsconfig to use es2015 modules 2016-06-21 23:19:26 -07:00
vsavkin 40e1112a8e chore(router): test karma config to rerun tests on change 2016-06-21 23:19:26 -07:00
Victor Berchet 397f5e2390 refactor(HtmlLexer): simplify the code 2016-06-21 18:03:22 -07:00
Victor Berchet 1a212259af refactor: cleanup lexers & parsers 2016-06-21 18:03:22 -07:00
Pawel Kozlowski f114dd300b fix(core): properly report missing providers and viewProviders (#9411)
Fixes #8237
2016-06-21 17:27:27 -07:00
vsavkin 15911367a2 refactor(router): removes a circualr dep 2016-06-21 12:17:30 -07:00
vsavkin 8dd3f59c81 chore(router): changes the router setup to align with other modules 2016-06-21 12:17:30 -07:00
vsavkin c9d28492b7 chore(router): remove lint and format tasks from router 2016-06-21 12:17:30 -07:00
vsavkin d1f93072a8 chore(router): clang-format 2016-06-21 12:17:30 -07:00
vsavkin 92d8bf9619 feat(router): add support for componentless routes 2016-06-21 12:17:30 -07:00
vsavkin bd2281e32d fix(resolve): change resolve not to resolve root activate route 2016-06-21 12:17:30 -07:00
vsavkin 0c50bc6449 fix(router): url serializer should handle segments without primary children 2016-06-21 12:17:30 -07:00
vsavkin f164715678 chore(README): fix a typo 2016-06-21 12:17:30 -07:00
vsavkin 2aa615b4ae chore(router): bump up version 2016-06-21 12:17:30 -07:00
vsavkin 42c89b1b9b docs(router): add a README to include a link to the guide 2016-06-21 12:17:30 -07:00
Dimitrios Loukadakis f6b75f56ad fix(router): typo in starts with slash validation error 2016-06-21 12:17:30 -07:00
vsavkin 280540e4a2 fix(router): change serialize not to require parenthesis in query string to be encoded 2016-06-21 12:17:30 -07:00
vsavkin fea216db12 fix(router): fixes a type issue in a test 2016-06-21 12:17:30 -07:00
vsavkin b260eb06f6 fix(router): change postinstall hook to devsetup to not require having 'typings' installed 2016-06-21 12:17:30 -07:00
vsavkin 1c937a10f9 chore(router): add changelog 2016-06-21 12:17:30 -07:00
vsavkin ca23b4c55f feat(router): add route config validation 2016-06-21 12:17:30 -07:00
vsavkin 7e12208ca6 feat(router): do not support paths starting with / 2016-06-21 12:17:30 -07:00
vsavkin 2773281338 feat(router): drop index property
Use path: '/' instead of 'index: true'
2016-06-21 12:17:30 -07:00
vsavkin f8e8d22e4e fix(router): stringify positional parameters when using routerLink 2016-06-21 12:17:30 -07:00
vsavkin cf4a9236b9 chore(router): bump up version number 2016-06-21 12:17:30 -07:00
vsavkin 4450e7b246 cleanup(router): enable noImplicitAny and noImplicntReturns 2016-06-21 12:17:30 -07:00
vsavkin cdbf67ee05 test(router): add a test checking that guards work for child routes 2016-06-21 12:17:30 -07:00
Dimitrios Loukadakis 9a67f38728 fix(router): port fixes done on angular current router to the new one
The bugs were fixed on current angular router in the following commits:
angular/angular@b2a7fd05cb
angular/angular@fa2ce8100b
angular/angular@595bcdd1ac

Closes #12
2016-06-21 12:17:30 -07:00
vsavkin 25560ed048 feat(router): implement RouterLinkActive 2016-06-21 12:17:30 -07:00
vsavkin 2aa19fd078 feat(router): support navigating by url tree 2016-06-21 12:17:30 -07:00
vsavkin cca9a58ded chore(router): bump up version number 2016-06-21 12:17:30 -07:00
Rob Wormald d6a25325c7 chore(package): unpin version 2016-06-21 12:17:30 -07:00
vsavkin a717da2d3e chore(router): bump up version number 2016-06-21 12:17:30 -07:00
vsavkin b3e801ed9e feat(router): make it work with TypeScript 1.8 2016-06-21 12:17:30 -07:00
vsavkin 3683fb6886 refactor(router): minor refactoring 2016-06-21 12:17:30 -07:00
vsavkin 3bd0ce291e feat(router): mark the index property as deprecated
Use {path: '', component: A} instead of {index: true, component: A}

}#
2016-06-21 12:17:30 -07:00
vsavkin 523fc5536c fix(router): fix Params type to allow passing any value types when calling router.navigate 2016-06-21 12:17:30 -07:00
vsavkin f5efccfb44 test(router): test update location when route does not change 2016-06-21 12:17:30 -07:00
vsavkin b6ec22de6b test(router): test empty url with global redirect 2016-06-21 12:17:30 -07:00
Rob Wormald 15f27b5455 fix(providers): make providers static analysis friendly 2016-06-21 12:17:30 -07:00
vsavkin 127401598b feat(router): implement terminal 2016-06-21 12:17:30 -07:00
vsavkin 503b07f698 docs(router): add a README 2016-06-21 12:17:30 -07:00
vsavkin f0a6329005 fix(router): fixes a typo 2016-06-21 12:17:30 -07:00
vsavkin 2982892acc cleanup(router): clang-format 2016-06-21 12:17:30 -07:00
vsavkin 9de56481f1 feat(router): add enableTracing option 2016-06-21 12:17:30 -07:00
vsavkin 777eb2f159 feat(router): emit an event when routes are recognized 2016-06-21 12:17:30 -07:00
vsavkin 05eebe0fed feat(router): provide meaningful toString impls 2016-06-21 12:17:30 -07:00
vsavkin fdfbbd5bac chore(router): bump up version number 2016-06-21 12:17:30 -07:00
vsavkin 1f3f8ef6c8 fix(router): fix nested deactivation 2016-06-21 12:17:30 -07:00
vsavkin 820eeb49d1 chore(router): bump up version number 2016-06-21 12:17:30 -07:00
vsavkin 2d4be1c9eb fix(router): init is not triggered in certain scenarios 2016-06-21 12:17:30 -07:00
vsavkin 2fef30f619 fix(router): make stringify handle nulls 2016-06-21 12:17:30 -07:00
vsavkin 10113b63b5 chore(router): bump up version number 2016-06-21 12:17:30 -07:00
vsavkin 545caab433 fix(router): use bootstrap listener to trigger initial navigation 2016-06-21 12:17:30 -07:00
vsavkin 3f90659cc1 fix(router): supports index routes with path 2016-06-21 12:17:30 -07:00
vsavkin 131914ac94 fix(router): fix lazy loading issues 2016-06-21 12:17:30 -07:00
vsavkin 29a7c4538c Revert "fix(provider): fix a circular dependency & remove common providers"
This reverts commit 6375fdd4f2928d5ddeccaf11a8589a7668bc9049.
2016-06-21 12:17:30 -07:00
vsavkin f195bb608c chore(router): update config before publishing to npm 2016-06-21 12:17:30 -07:00
vsavkin 66caabca0c feat(router): implement redirectTo 2016-06-21 12:17:30 -07:00
Victor Berchet 25c6a3715d fix(provider): fix a circular dependency & remove common providers 2016-06-21 12:17:30 -07:00
Mike Ryan 97cf0e40d5 fix(guards): Cancel in-flight guards if one returns false 2016-06-21 12:17:30 -07:00
vsavkin 6988a550ea cleanup(router): fix tslint errors 2016-06-21 12:17:30 -07:00
Victor Berchet 8a1cdc2dd5 chore: install typings with npm i 2016-06-21 12:17:30 -07:00
Victor Berchet dadd5ddded chore: add lint and clang-format 2016-06-21 12:17:30 -07:00
vsavkin 56f8c95ee9 tests(router): add tests verifying that updating secondary segments using router link works 2016-06-21 12:17:30 -07:00
vsavkin ed50e17e5b refactor(router): rename queryParameters into queryParams 2016-06-21 12:17:30 -07:00
vsavkin 33b518ad21 feat(router): update RouterLink to support query params and fragment 2016-06-21 12:17:30 -07:00
vsavkin b0e7c14545 fix(router): add an app initializer to trigger initial navigation
Closes #10
2016-06-21 12:17:30 -07:00
vsavkin 5742d4720a fix(router): fix router to handle guards that return observable
Closes #19
2016-06-21 12:17:30 -07:00
vsavkin 9b356d9b86 fix(router): traverse route config in depth-first order
Closes #17
2016-06-21 12:17:30 -07:00
Brandon Roberts 793ac3f6b4 Configure router with provided routes
Closes #9
2016-06-21 12:17:30 -07:00
vsavkin 9b094e42a3 chore(router): update the npm dist 2016-06-21 12:17:30 -07:00
vsavkin 6ce7a5a1ea docs(router): add docs 2016-06-21 12:17:30 -07:00
vsavkin 88920bfee1 feat(router): add support for basic events 2016-06-21 12:17:30 -07:00
vsavkin 2717bcc3af feat(router): implement cancelation 2016-06-21 12:17:30 -07:00
vsavkin 5d386dc426 chore(router): update build dir 2016-06-21 12:17:30 -07:00
vsavkin f34af4f249 feat(router): add support for using classes as guard 2016-06-21 12:17:30 -07:00
vsavkin f04b6978fb cleanup(router): add @internal to constructors where needed 2016-06-21 12:17:30 -07:00
vsavkin ab958598d7 feat(router): implement CandDeactivate 2016-06-21 12:17:30 -07:00
vsavkin 1914847e72 cleanup(router): make strictNullChecks happy 2016-06-21 12:17:30 -07:00
vsavkin d95f0fd83d fix(router): fix index routes 2016-06-21 12:17:30 -07:00
vsavkin 243612e36d refactor(router): rename candidate into snapshot 2016-06-21 12:17:30 -07:00
vsavkin c5cca8e098 feat(router): add support for CanActivate guard 2016-06-21 12:17:30 -07:00
vsavkin 99f7404d8b refactor(router): remove rootNode function 2016-06-21 12:17:30 -07:00
vsavkin 9ff6b0828f feat(router): make activation sync 2016-06-21 12:17:30 -07:00
vsavkin 6f052d1daf feat(router): add a function to resolve components 2016-06-21 12:17:30 -07:00
vsavkin 63c194b71f feat(router): change recognize to return a router state candidate 2016-06-21 12:17:30 -07:00
vsavkin 46911117f1 feat(router): implement a function create router state out of a candidate 2016-06-21 12:17:30 -07:00
vsavkin 2de1030413 feat(router): add RouterStateCandidate 2016-06-21 12:17:30 -07:00
vsavkin 1f6ade894e cleanup(router): fix a typo 2016-06-21 12:17:30 -07:00
vsavkin 8407cfeac7 fix(router): fix router to take root component type instead of instance 2016-06-21 12:17:30 -07:00
vsavkin 91d64a2855 feat(router): export provideRouter via index 2016-06-21 12:17:30 -07:00
vsavkin 40a06af79b feat(router): add provideRouter to configure the router when bootstrapping an app 2016-06-21 12:17:30 -07:00
vsavkin 8aef86f4a0 feat(router): export all public api tokens via index 2016-06-21 12:17:30 -07:00
vsavkin 5bdc6ecec8 chore: adds the build dir to use with 'npm install' 2016-06-21 12:17:30 -07:00
vsavkin c179b5033b feat(router): implement relative navigation 2016-06-21 12:17:30 -07:00
vsavkin 86f47273bc feat(router): changes router config not to use names 2016-06-21 12:17:30 -07:00
vsavkin 2e1bd46bb1 feat(router): add createUrlTree 2016-06-21 12:17:30 -07:00
vsavkin a9e773b47b feat(router): serialize outlet names into the url 2016-06-21 12:17:30 -07:00
vsavkin 10d38cbb72 chore(router): change karma reporter 2016-06-21 12:17:30 -07:00
vsavkin a5371bfb8a cleanup: cleanup tsconfig files 2016-06-21 12:17:30 -07:00
vsavkin 4b2740f270 refactor: move index.ts into src 2016-06-21 12:17:30 -07:00
vsavkin 5b371736b2 feat: add RouterLink 2016-06-21 12:17:30 -07:00
vsavkin c9b4bcf689 refactor: move all utility functions into the utils dir 2016-06-21 12:17:30 -07:00
vsavkin 013f9a2bbc feat: add tree.siblings 2016-06-21 12:17:30 -07:00
vsavkin 5bf1c93ead docs: adds missing api docs 2016-06-21 12:17:30 -07:00
vsavkin 4f6ec01932 feat: implement a simple version of the router service 2016-06-21 12:17:30 -07:00
vsavkin 0f79e504c9 test: set up karma to support fakeAsync 2016-06-21 12:17:30 -07:00
vsavkin 1a4e911b8b cleanup: fix type errors when compiling with strictNullChecks enabled 2016-06-21 12:17:30 -07:00
vsavkin 1f98519380 feat: implement RouterOutletMap 2016-06-21 12:17:30 -07:00
vsavkin aad7010952 feat: add RouterOutlet 2016-06-21 12:17:30 -07:00
vsavkin 1be9ea681b fix: fix source maps 2016-06-21 12:17:30 -07:00
vsavkin f259a2204b feat: implement recognizer 2016-06-21 12:17:30 -07:00
vsavkin 4b1db0e61c feat: implement default url serializer 2016-06-21 12:17:30 -07:00
vsavkin aee764d14d chore: update TS to enable non-nullable types 2016-06-21 12:17:30 -07:00
vsavkin 47585498af chore: updates typings to head 2016-06-21 12:17:30 -07:00
vsavkin 37c5320e33 feat: implement Tree 2016-06-21 12:17:30 -07:00
vsavkin 01111a1122 cleanup: removes a fake test 2016-06-21 12:17:30 -07:00
Rob Wormald 0b2bb1b6f5 chore(typings): use typings instead of tsd 2016-06-21 12:17:30 -07:00
vsavkin f57df3cf8a chore: set up test and build infrastructure 2016-06-21 12:17:30 -07:00
Victor Berchet c9c81e1fbc fix(XmbSerializer): add meaning attribute, escape attribute values 2016-06-21 11:52:11 -07:00
Victor Berchet e38e04c1c2 refactor(MessageExtractor): pass the interpolationConfig around 2016-06-21 11:52:11 -07:00
Victor Berchet 99587ea4ed refactor(i18n): misc 2016-06-21 11:52:11 -07:00
Victor Berchet 58b18d7fe7 fix(partition): fix partition when `<!-- i18n -->` is the only child 2016-06-21 11:52:11 -07:00
Victor Berchet 04a50f5832 feat(MessageExtractor): do not expand ICU messages before extraction 2016-06-21 11:52:11 -07:00
Rob Wormald e157a065b0 fix(compiler): codegen view query generic types 2016-06-21 11:51:54 -07:00
James Ward 41ef4b3d4a chore(npm): add repository metadata 2016-06-21 11:21:04 -07:00
Edd Hannay 262650ab39 docs(test_injector): Fix documentation typo (#9403)
- Change 'teh' for 'the'
2016-06-21 11:19:08 -07:00
Igor Minar 8c076d5a73 fix(upgrade): fix bundling issue and fix e2e test
the previous demo app was broken and is missing an e2e test.

I fixed the app, but was not able to get protractor to properly test
this app. Julie and I are looking into that. For now I manually verified
that the app works and that the original issue was fixed.

Closes #9244
2016-06-21 11:12:42 -07:00
Victor Berchet c5c456120c refactor: delete containsRegexp() (there is escapeRegExp() in the lang facade)
BREAKING CHANGES:

`containsRegexp` is no more exported from `@angular/core/testing`. It should not have been part of the public API in the first place.
2016-06-21 09:15:21 -07:00
Pawel Kozlowski fdf6bc18dd fix(compiler): properly report unresolved dependencies
Fixes #9332

Closes #9341
2016-06-21 16:36:57 +02:00
PatrickJS 297f0fd2c3 fix(core/testing): show full error
test(platform-browser): update fail capture

test(platform-browser-dynamic): update fail capture
2016-06-20 19:36:37 -07:00
Victor Berchet 12c49042ab fix(HTTP/XhrBackend): correctly set the status code on errors (#9355)
fixes #9329
fixes angular/http#54
2016-06-20 15:02:14 -07:00
Matias Niemelä ba46ca683b fix(animations): ensure starting styles are applied when a delay is present
Closes #9326
Closes #9328
2016-06-20 11:16:39 -07:00
Victor Berchet ca42b49fa2 refactor: misc cleanup (#9369) 2016-06-20 10:55:29 -07:00
Victor Berchet 1b28cf71f5 feat(compiler): make interpolation symbols configurable (`@Component` config) (#9367)
closes #9158
2016-06-20 09:52:41 -07:00
vsavkin af2f5c3d7d cleanup(router): removes router 2016-06-20 08:47:54 -07:00
Jesús Rodríguez 65be81baf8 doc(CheatSheet): update ngSwitch syntax in the cheatsheet (#9361) 2016-06-20 08:05:50 -07:00
Misko Hevery 7a3689f175 chore: formating 2016-06-19 22:27:29 +02:00
Misko Hevery 8675b8dc48 fix: cleanup public api of platform-server
BREAKING CHANGE: Parse5Adapter is no longer exported as public API, use serverBootstrap()

Parse5Adapter is an implementation detail not a public API

Closes #9237

Closes #9205
2016-06-19 09:03:01 -07:00
Misko Hevery 279e816ea7 chore: Remove unnecessary calls to Parse5DomAdapter
This reverts commit 80deac5cde.
2016-06-19 08:42:00 -07:00
Andrei Tserakhau 2d60ff14ae bug(datePipe): date format pipe's 2-digit interpretation of minutes and seconds (#9338)
Closes #9333
2016-06-18 09:03:58 -07:00
Tobias Bosch c0f2a22a08 fix(perf): support prod mode again
After splitting the facades into multiple modules,
enabling prod mode for code had no effect for the compiler.

Also in a change between RC1 and RC2 we created the `CompilerConfig`
via a provider with `useValue` and not via a `useFactory`, which reads
the prod mode too early.

Closes #9318
Closes #8508
Closes #9318
2016-06-17 15:59:27 -07:00
Andrei Tserakhau 5c8d3154d7 feat(datePipe): numeric string support 2016-06-17 15:58:06 -07:00
Victor Berchet 40f8a45b95 test(DatePipe): fixes 2016-06-17 15:48:26 -07:00
Victor Berchet 76a418760e fix(BrowserUtil): fix `supportsIntlApi()` 2016-06-17 15:34:12 -07:00
Victor Berchet 49bf3f5b3a fix(NumberPipe): fix broken RegExp
introduced in 7498050421 (#9308)
2016-06-17 15:33:25 -07:00
Alfonso Presa 773c34900f fix(change_detection): ChangeDetectorRef reattach should restore original mode
After using ChangeDetectorRef detach, it should keep the ChangeDetector mode so that it is restored after calling reattach.

closes #7078
closes #7080
2016-06-17 15:00:41 -07:00
Chuck Jazdzewski 791153c93c fix(compiler): StaticReflector ignores unregistered decorators. (#9266)
Also modified static reflector to allow writing tests in using
the .ts and using the MetadataCollector.

Also made MetadataCollector be able to use SourceFiles that have
not been bound (that is, don't have the parent property set).

Fixes #9182
Fixes #9265
2016-06-17 13:11:00 -07:00
Victor Berchet 721f53f0d6 feat(I18N Expander): do not add extra `<ul>` & `<li>` around ICU messages (#9283)
fixes #9072
2016-06-17 11:38:24 -07:00
Victor Berchet 7498050421 refactor: misc (#9308) 2016-06-17 10:57:50 -07:00
Victor Berchet 5e3ccbcea9 refactor: add types (#9288) 2016-06-17 10:57:32 -07:00
Martin Probst 8879aa1df4 feat(security): fail more detectably when using a safe value in an interpolation.
If a user ends up with a safe value in an interpolation context, that's probably
a bug. Returning `"SafeValue must use [property]= binding"` will make it easier
to detect and correct the situation. Detecting the situation and throwing an
error for it could cause performance issues, so we're not doing this at this
point (but might revisit later).

Part of #8511 and #9253.
2016-06-17 10:00:30 -07:00
Victor Berchet 44e0ad4987 refactor(forms): remove the facade local copy (#9276) 2016-06-17 08:53:17 -07:00
Pawel Kozlowski 5fe60759f9 feat(QueryList): support index in callbacks
Closes #9278
2016-06-17 08:09:42 -07:00
Matias Niemelä 45549cda61 refactor(core): get rid of the bitwise operator facade helpers 2016-06-16 14:31:55 -07:00
Matias Niemelä a13052fc73 refactor(core): rename css_parser and css_lexer files
Closes #9273
2016-06-16 14:31:48 -07:00
Matias Niemelä 4e7bb03e81 refactor(core): rename `AST` to `Ast` for all CSS parser code 2016-06-16 14:31:41 -07:00
Matias Niemelä 935c39a7e2 feat(core): ensure CSS parser tracks start/end values and understands complex pseudo selectors 2016-06-16 14:31:34 -07:00
Victor Berchet c08ca22dba refactor(HtmlParser): clang format 2016-06-16 13:54:00 -07:00
Alex Eagle 37b617dccf chore(tsickle): add @Annotation annotations
This lets users continue using runtime-sideeffect Decorators if they choose,
only down-leveling the marked ones to Annotations.

Also remove the "skipTemplateCodegen" option, which is no longer needed
since Angular compiles with tsc-wrapped rather than ngc. The former doesn't
include any codegen.
2016-06-16 12:29:46 -07:00
Victor Berchet c60ef45bc8 fix(HtmlParser): add missing ; 2016-06-16 10:23:02 -07:00
Olivier Chafik 6686bc62f6 feat(benchpress): add custom user metric to benchpress
This is a continuation of #7440 (@jeffbcross).

Closes #9229
2016-06-16 07:30:53 -07:00
Victor Berchet 1eaa193c51 feat(compiler-cli): add a `debug` option to control the output
fixes #9208
2016-06-15 18:13:57 -07:00
Victor Berchet b620f4f456 feat(DomElementSchemaRegistry): add support for <ng-content> and <ng-container> 2016-06-15 18:13:57 -07:00
Victor Berchet e484c62a8d fix(HtmlParser): do not add required parents to template root elements
fixes #5967
2016-06-15 18:13:57 -07:00
Victor Berchet 9ba400d7d5 fix(HtmlParser): consider <ng-container> when adding required parents 2016-06-15 18:13:57 -07:00
Victor Berchet 9cbd8f7afc test(ng-container): test nesting ng-containers 2016-06-15 18:13:57 -07:00
Kara Erickson 8e6e90e703 fix(forms): ngModel should export as ngModel 2016-06-15 17:46:45 -07:00
Igor Minar 26676c4833 docs(webworker): add/correct experimental markers to web worker apis 2016-06-15 17:12:40 -07:00
Kara Erickson 39e0b4903c feat(radio): support radio button sharing a control 2016-06-15 15:27:34 -07:00
Jesús Rodríguez 54c577cfe0 chore: update cheatsheet for new provider syntax (#9227) 2016-06-15 15:11:39 -07:00
Igor Minar 933f45ef31 docs(webworkers): add experimental markers for all web worker public apis 2016-06-15 09:38:03 -07:00
Igor Minar 4fc37aeabd fix(webworkers): rename all web worker apis with "render" to "ui"
"render" is gramatically incorrect and confusing to developers who used this api.

Since webworker apis were exposed only in master, renaming these before the rc2 release
is not a breaking change
2016-06-15 09:38:03 -07:00
Kara Erickson 2fd1e88199 fix(forms): suppress forms deprecation warning after first 2016-06-15 08:52:56 -07:00
Misko Hevery d44d0852e5 Revert "fix: cleanup public api of platform-server"
This reverts commit ac84468f1c.
2016-06-14 19:40:43 -07:00
Misko Hevery 80deac5cde Revert "chore: Remove unnecessary calls to Parse5DomAdapter"
This reverts commit 387a90e546.
2016-06-14 19:40:43 -07:00
Victor Berchet 8a54c1a115 refactor(ViewBuilder): cleanup 2016-06-14 19:11:30 -07:00
Victor Berchet 0dbff55bc6 feat(Compiler): add support for `<ng-container>`
`<ng-container>` is a logical container that can be used to group nodes but is not rendered in the DOM tree as a node.

`<ng-container>` is rendered as an HTML comment.
2016-06-14 19:11:30 -07:00
Kara 22916bb5d1 feat(forms): add easy way to switch between forms modules (#9202) 2016-06-14 18:23:40 -07:00
Victor Berchet fe01e2efb7 feat(I18nExtractor): Add file paths to error messages (#9177)
* feat(I18nExtractor): Add file paths to error messages

relates to #9071

* feat(i18n): allow i18n start comments without meaning

* refactor(i18n): cleanup

* test(HtmlParser): Add depth to expansion forms
2016-06-14 17:50:23 -07:00
Igor Minar 7afee97d1b fix(platform-server): correctly import private DOMTestComponentRenderer 2016-06-14 17:26:55 -07:00
Igor Minar 6fc267f22c fix: split dynamic bits in platform-browser into platform-browser-dynamic
Previously these symbols were exposed via platform-browser-dynamic, then we merged then into platform-browser
thinking that tools would know how to shake off the compiler and other dynamic bits not used with the offline
compilation flow. This turned out to be wrong as both webpack and rollup don't have good enough tree-shaking
capabilities to do this today. We think that in the future we'll be able to merge these two entry points into
one, but we need to give tooling some time before we can do it. In the meantime the reintroduction of the -dynamic
package point allows us to separate the compiler dependencies from the rest of the framework.

This change undoes the previous breaking change that removed the platform-browser-dynamic package.
2016-06-14 15:31:24 -07:00
Misko Hevery ac84468f1c fix: cleanup public api of platform-server
BREAKING CHANGE: Parse5Adapter is no longer exported as public API, use serverBootstrap()

Parse5Adapter is an implementation detail not a public API
2016-06-14 13:21:28 -07:00
Misko Hevery 387a90e546 chore: Remove unnecessary calls to Parse5DomAdapter 2016-06-14 13:07:11 -07:00
Kara Erickson a191e9697c feat(forms): support setting control name in ngModelOptions 2016-06-13 16:57:10 -07:00
Chuck Jazdzewski 5504ca1e38 feat(compiler): Added support for limited function calls in metadata. (#9125)
The collector now collects the body of functions that return an
expression as a symbolic 'function'. The static reflector supports
expanding these functions statically to allow provider macros.

Also added support for the array spread operator in both the
collector and the static reflector.
2016-06-13 15:56:51 -07:00
Kara Erickson 5c0cfdee48 fix(forms): separate ngModelGroup from formGroupName 2016-06-13 13:41:39 -07:00
Tobias Bosch bc888bf3a1 refactor(compiler): Change arguments of `CompilerConfig` to named arguments
BREAKIKNG CHANGE:
`CompilerConfig` used to take positional arguments and now takes named arguments.

Closes #9172
2016-06-13 13:14:07 -07:00
Tobias Bosch 1745366530 refactor(compiler): make `PLATFORM_PIPES` / `PLATFORM_DIRECTIVES` an option on `CompilerConfig`
This aligns the configuration of platform pipes / directives with offline compilation.

BREAKING CHANGE:
- `PLATFORM_PIPES` and `PLATFORM_DIRECTIVES` now are fields on `CompilerConfig`. 
  Instead of providing a binding to these tokens, provide a binding for `CompilerConfig` instead.
2016-06-13 13:13:45 -07:00
Kara Erickson 61960c51a3 feat(forms): compose validator fns automatically if arrays 2016-06-13 11:41:32 -07:00
ScottSWu 14a3ade662 chore(typescript): Changed double asterisks in #9100 to single asterisks
As in #9151, these comments are being read as JSDoc comments. This commit is smaller and only touches a few files that are causing errors.
2016-06-13 10:53:31 -07:00
Wassim Chegham de97687422 docs(i18n): fix typo (#9165) 2016-06-13 10:00:57 -07:00
Victor Berchet a0251305ea doc(CompilerCli): Add a bootstrap example for a compiled application 2016-06-13 08:59:16 -07:00
Kara Erickson 2b8d12ddf0 chore(forms): rename ngControl to formControlName 2016-06-12 13:17:36 -07:00
Victor Berchet 1f6fd3c8fc refactor: add types (#9148) 2016-06-11 21:23:37 -07:00
Matias Niemelä 55860e1621 fix(animations): ensure AUTO styles are cleared at the end of the state-change animation
Closes #9014
Closes #9015
2016-06-11 00:08:41 -07:00
Matias Niemelä 4d51158b1a fix(animations): ensure the web-animations driver converts style props to camel-case
The web animations API now requires that all styles are converted to
camel case. Chrome has already made this breaking change and hyphenated
styles are not functional anymore.

Closes #9111
Closes #9112
2016-06-10 22:54:10 -07:00
Kara Erickson 7d9c1e1225 chore(forms): rename ngFormModel to formGroup 2016-06-10 19:10:17 -07:00
Kara Erickson d53edfec47 chore(forms): rename ngFormControl to formControl 2016-06-10 17:28:19 -07:00
Victor Berchet a6e5ddc5af feat(ComponentResolver): Add a SystemJS resolver for compiled apps (#9145) 2016-06-10 16:31:34 -07:00
Kara Erickson b866f32832 chore(forms): rename Control, ControlGroup, and ControlArray classes 2016-06-10 12:00:18 -07:00
Kara Erickson 97833d48c1 chore(templateOutlet): fix linting 2016-06-10 11:32:09 -07:00
Misko Hevery 9c0031f7a5 fix: broken build due to bad noImplicitAny merge 2016-06-10 10:35:36 -07:00
Shlomi Assaf 164a091c71 feat(NgTemplateOutlet): add context to NgTemplateOutlet
Closes #9042
2016-06-10 10:25:44 -07:00
Kara Erickson 4ed6cf7519 feat(forms): allow ngModel to register with parent form 2016-06-10 10:24:01 -07:00
Victor Berchet 5267115481 feat(I18N): generate error on unknown cases
fixes #9094
2016-06-10 08:45:59 -07:00
Victor Berchet 43148d8233 feat(HtmlLexer): add support for alphabetic cases 2016-06-10 08:45:59 -07:00
Vivek Ghaisas 537e99b4ea fix(http): respect custom Content-Type header in XHRConnection (#9131)
Fix a bug due to which setting a custom Content-Type header in the
Request led to multiple Content-Types being set on the sent
XMLHttpRequest: first the detected content type based on the request
body, followed by the custom set content type.

Fix #9130.
2016-06-10 08:18:49 -07:00
Rob Wormald e1fcab777c fix(ngSwitch): use switchCase instead of switchWhen (#9076) 2016-06-09 22:52:30 -07:00
Alex Eagle f39c9c9e75 style(lint): re-format modules/@angular 2016-06-09 17:00:15 -07:00
Pawel Kozlowski 3aca5ff9e2 fix(compiler): properly report missing DI tokens (#9065)
Fixes #8245
2016-06-09 16:07:06 -07:00
Idir Ouhab Meskine 9146bb0816 docs(DatePipe): Update date doc reference in date_pipe.ts (#9081) 2016-06-09 16:05:13 -07:00
Pawel Kozlowski 0c9e8dbf60 docs(linker): document the injector argument as mandatory (#9098)
Fixes #8600
2016-06-09 16:03:42 -07:00
Chuck Jazdzewski 0658eb4429 fix(compiler): Added unit test to ReflectorHost and fixed issues (#9052)
Refactored ReflectorHost to allow it to be tested.
Fixed an issue where the .d.ts was findable but it wasn't used by the project
  (This happens when the .metadata.json file references a module that was not
   needed, such as it doesn't declare any types, and the reference to it was
   elided by TypeScript when writing the .d.ts file).
Added tests for ReflectorHost
2016-06-09 14:51:53 -07:00
Chuck Jazdzewski e178ee4ba0 fix(compiler): Added support for '* as m' style imports. (#9077)
Also includes fixes for broken test.
2016-06-09 13:23:29 -07:00
Martin Probst 729dc3b764 fix(security): support XSSI prefixes with and without commas.
Some implementations use an XSSI prefix with a trailing comma, some without.
This changes Angular to support both.
2016-06-09 11:32:07 -07:00
Victor Berchet 7ce0fc7d47 refactor: add types (#9116) 2016-06-09 11:04:15 -07:00
Martin Probst 346304762e feat(security): document <iframe src> to be TRUSTED_URL.
Docs on the DomSanitizationService didn't match actual usage before.

Also fixes some minor docs and implementation issues.
2016-06-08 20:49:15 -07:00
Kara Erickson e213939f28 chore(forms): fix implicit any 2016-06-08 17:08:59 -07:00
Kara Erickson 4c39eace52 feat(forms): add new forms folder 2016-06-08 16:41:08 -07:00
ScottSWu 86fbd50c3d refactor(TypeScript): Add noImplicitAny
We automatically insert explicit 'any's where needed. These need to be
addressed as in #9100.

Fixes #4924
2016-06-08 16:20:50 -07:00
Miško Hevery 87d824e1b4 fix: add typescript test for our typings (#9096)
* Revert "fix(d.ts): enable angular2 compilation with TS flag --strictNullChecks (#8902)"

This reverts commit 7e352a27f7.

* test: add typescript test for our typings
2016-06-08 16:06:23 -07:00
Kara Erickson 50acb96130 fix(forms): update value and validity when controls are added
Closes #8826
2016-06-08 14:06:20 -07:00
Igor Minar 29c2dcff61 fix(http): remove peerDep on @angular/common
it is not needed there because it will get transitively installed by @angular/platform-browser

we only need to declare this dependency in tsconfig.json because tsconfig.json's
do not support transitive dependencies in this way.
2016-06-08 12:20:42 -07:00
Igor Minar d18694a1c3 Revert "WIP: test: add tree-shaking test (#8979)"
This reverts commit b746c64229.

Reason: bad merge via github ui
2016-06-08 12:20:17 -07:00
Igor Minar b746c64229 WIP: test: add tree-shaking test (#8979)
* test: add tree-shaking test

currently this doesn't throw or break the build, first we need to resolve all
of the existing issues.

to run execute: ./tools/tree-shaking-test/test.sh

then inspect dist/tree-shaking/test/**/*.bundle.js

* fix(http): remove peerDep on @angular/common

it is not needed there because it will get transitively installed by @angular/platform-browser

we only need to declare this dependency in tsconfig.json because tsconfig.json's
do not support transitive dependencies in this way.
2016-06-08 12:15:09 -07:00
Kara Erickson 515a8e0765 fix(forms): rename old forms folder to forms-deprecated 2016-06-08 11:21:58 -07:00
Igor Minar 45de65bd45 fix(router): don't mark the RouterOutletMap as internal
it's currently being reexported as public api which breaks anyone tryin to import
the router because the RouterOutletMap definition is missing
2016-06-08 11:18:35 -07:00
Victor Berchet ac1156739d feat(i18n): extract messages 2016-06-07 15:17:02 -07:00
Torgeir Helgevold 7cefec77ef fix(ngUpgrade): prevent digest already in progress (#9054)
fix(ngUpgrade): prevent digest already in progress
2016-06-07 15:10:13 -07:00
Matias Niemelä 36d25f2a07 feat(animations): support styling of the default animation state
It is now possible to set a fallback state that will apply its
styling when the destination state is not detected.

```ts
state("*", style({ ... }))
```

Closes #9013
2016-06-07 12:59:33 -07:00
Tobias Bosch c3d2459a4e fix(query): set fixed `@ViewChild` / `@ContentChild` right after the view is created
This is needed to have a true replacement of the previous
`DynamicComponentLoader.loadNextToLocation`, so that components
can be loaded into the view before change detection runs.

Closes #9040
2016-06-07 12:40:35 -07:00
Tobias Bosch 8847580fd7 Revert "fix(compiler): add ability to parse : in * directives"
This reverts commit 53628e19ac.
as it breaks pipe arguments in `*ngFor`, ...

See #9062
Closes #9063
2016-06-07 12:39:17 -07:00
Chuck Jazdzewski cf3548a02f fix(compiler): Improved error reporting of the static reflector.
StaticReflector provides more context on errors reported by the
collector.

The metadata collector now records the line and character of the node that
caused it to report the error.

Includes other minor fixes to error reporting and a wording change.

Fixes #8978
Closes #9011
2016-06-07 08:38:32 -07:00
Chuck Jazdzewski c197e2bb42 Revert "fix(ngUpgrade): prevent digest already in progress (#9046)"
This reverts commit d1c989b8a5.

Breaks a Karma test.
2016-06-06 16:30:11 -07:00
Torgeir Helgevold d1c989b8a5 fix(ngUpgrade): prevent digest already in progress (#9046) 2016-06-06 13:34:27 -07:00
Rob Wormald a19c4e8f9a fix(upgrade): allow functions for template and templateUrl (#9022) 2016-06-04 19:53:51 -07:00
PatrickJS 53083c0b52 refactor(testing): type beforeEachProviders (#9023)
these are valid otherwise
```typescript
beforeEachProviders(1)
beforeEachProviders('wat')
beforeEachProviders([
  Http
])
```
2016-06-04 19:52:51 -07:00
PatrickJS 994d9212c1 docs(NgControlName): correct exports name (#9021) 2016-06-04 19:48:50 -07:00
Pawel Kozlowski 52ddc96c9f refactor(compiler): remove obsolete @View-related code (#9019) 2016-06-04 19:46:55 -07:00
Pawel Kozlowski 057abefe50 fix(compiler): report errors for queries without selectors (#9018)
Fixes #4489
2016-06-04 19:46:03 -07:00
Matias Niemelä a1e3004e62 docs(animations): provide API docs for the animation DSL
Closes #8970
2016-06-03 18:57:17 -07:00
Matias Niemelä e504d4eb05 fix(renderer): remove unecessary setElementStyles method
There is no need to expose this additional method inside of the Renderer
API. The functionality can be restored by looping and calling
`setElementStyle` instead.

Note that this change is changing code that was was introduced after
the last release therefore this fix is not a breaking change.

Closes #9000
Closes #9009
2016-06-03 15:20:34 -07:00
Victor Berchet a6ad61d83e refactor: change provide(...) for {provide: ...}
- provide() is deprecated,
- {} syntax is required by the offline compiler
2016-06-03 15:03:49 -07:00
Victor Berchet 27a47e7841 refactor(imports): simplify paths 2016-06-03 14:46:04 -07:00
Matias Niemelä b00b9fe564 chore(README): update missing step in compiler-cli docs README 2016-06-03 14:36:16 -07:00
Matias Niemelä fa0718ba9a feat(animations): provide support for offline compilation 2016-06-03 14:36:11 -07:00
Matias Niemelä 155b88213c feat(debug): collect styles and classes for the DebugElement 2016-06-03 14:36:06 -07:00
Chuck Jazdzewski 35ea02fb81 fix(compiler): Reflector generates imports for '..' relative modules.
Fixes #9003
Closes #9004
2016-06-03 12:54:30 -07:00
Tobias Bosch ddd2ac4f55 fix(core): fix type of `DebugNode.properties` (#8964)
Properties can have any value, not just strings.
2016-06-03 10:51:13 -07:00
Pawel Kozlowski 6f281ab3c4 fix(HTMLParser): properly report errors for not properly closed tags (#8999)
Fixes #7849
2016-06-03 10:49:17 -07:00
Igor Minar 76e6214b9b chore: remove angular_entry point (#8975)
this is obsolete and no longer needed. it wasn't part of the public api so it's ok to remove.
2016-06-03 10:47:55 -07:00
Chuck Jazdzewski 2d8f776e38 feat(build): Added a version stamp in .metadata.json files.
Also modified StaticReflector to handle multiple versions in a
single .metadata.json file.

Fixes #8974
Closes #8981
2016-06-03 10:40:49 -07:00
Sekib Omazic cf2d3cf920 style(pipes): cleanup unused imports
Remove unused imports from the pipes package. No impact on the code.
2016-06-03 09:58:57 -07:00
Miško Hevery b160ada5d1 fix: QueryList documentation (#8976) 2016-06-02 16:24:26 -07:00
Victor Berchet 1090601e8b refactor(compiler): rename /compiler_cli to /compiler-cli 2016-06-02 13:50:32 -07:00
Chuck Jazdzewski 01dd7dde24 chore(tools): Remove use of TypeChecker from metadata collector.
The metadata collector was modified to look up references in the
import list instead of resolving the symbol using the TypeChecker
making the use of the TypeChecker vestigial. This change removes
all uses of the TypeChecker.

Modified the schema to be able to record global and local (non-module
specific references).

Added error messages to the schema and errors are recorded in
the metadata file allowing the static reflector to throw errors
if an unsupported construct is referenced by metadata.

Closes #8966
Fixes #8893
Fixes #8894
2016-06-02 13:39:15 -07:00
Chuck Jazdzewski 13c39a52c6 chore(compiler): Expose types needed by the language service
The language service needs access to the parser error ranges and
the static reflector.

Closes #8838
2016-06-02 13:36:22 -07:00
Victor Berchet 3b80ab51ba feat(SchemaRegistry): add Node.textContent
fixes #8413
2016-06-02 13:33:57 -07:00
Victor Berchet 1a386a58c8 Revert "feat(change_detection): make INTERPOLATE_REGEXP customizable (#7417)"
This reverts commit c3fafa0651.

The symbols should be configured at the component level and not be global to the compiler.
2016-06-01 17:53:45 -07:00
Tobias Bosch 04220be8fd chore: remove old tests (#8954)
These tests are already captured in template_parser_spec.ts
2016-06-01 16:30:51 -07:00
Hannah Howard 48bf349c3c fix(upgrade): allow deeper nesting of ng2 components/directives (#8949)
* fix(upgrade): add test for upgrade adapter bug

* fix(upgrade): allow deeper nesting of ng2 components/directives

allow a nesting sequence of ng2 > ng1 > ng2 directives
2016-06-01 15:58:40 -07:00
laco0416 602836800b feat(ChangeDetectorRef): make detectChanges() correct
Closes #8599
2016-06-01 12:50:47 -07:00
Igor Minar a738d0d54d chore: remove old public api tests
the tests under tools/public_api_guard have better coverage - we no longer need
to maintain two copies.
2016-06-01 10:43:57 -07:00
Igor Minar dd6cb233b5 build: add missing testing.ts entry points to tsconfigs 2016-06-01 10:43:22 -07:00
Igor Minar a3cf58b67a docs: add info about __moduleName into to DirectiveMetadata docs 2016-06-01 10:43:22 -07:00
Igor Minar 70d944a59c refactor: correct api modifier flags 2016-06-01 10:43:22 -07:00
Igor Minar a5a422f8e7 refactor(NumberPipe): remove NumberPipe and replace it with private helper function
NumberPipe was just an implementation detail that we were accidentaly exposing as a public api.
2016-06-01 10:43:22 -07:00
Igor Minar e93b3d2360 fix(Location): make Location#platformStrategy:LocationStrategy property private
BREAKING CHANGE: Location#platformStrategy property was previously accidentaly exported as public

If any application requires access to the current location strategy, it should be accessed via DI instead
by injecting the LocationStrategy token.

The likelyhood of anyone actually depending on this property is very low.
2016-06-01 10:43:22 -07:00
Igor Minar 7bc2d9a93a docs: add api stability indicators for @angular/common 2016-06-01 10:43:22 -07:00
Hannah Howard 1c929031a2 feat(router): export RouterLink and RouterOutlet (#8912)
Makes it possible to individually import RouterLink and RouterOutlet from the router module
2016-06-01 09:48:55 -07:00
Victor Berchet f2809d1ed8 fix(PostMessageBus):Add the worker scope to please Closure 2016-06-01 09:24:05 -07:00
Vikram Subramanian f4f6b8721a fix(core): Keep core exports seperate from core/testing exports. 2016-05-31 20:09:43 -07:00
opensrcken 7e352a27f7 fix(d.ts): enable angular2 compilation with TS flag --strictNullChecks (#8902)
Eliminate the following compiler error when using TS 1.9+ with strict null checking enabled:

node_modules/@angular/core/src/util/decorators.d.ts(9,5): error TS2411: Property 'extends' of type 'Type | undefined' is not assignable to string index type 'Type | Function | any[]'.

https://github.com/angular/angular/issues/8720
2016-05-31 18:25:48 -07:00
Tom 0c6b16c208 docs(async-pipe): include observable example (#8900)
Adds the missing example, usage case and a bit more description to the async-pipe.
2016-05-31 18:23:29 -07:00
Martin Probst 10475b859d chore: remove deep imports to fix build. 2016-05-31 17:13:41 -07:00
Martin Probst 4d793c4eb8 feat(security): Automatic XSRF handling.
Automatically recognize XSRF protection cookies, and set a corresponding XSRF
header. Allows applications to configure the cookie names, or if needed,
completely override the XSRF request configuration by binding their own
XSRFHandler implementation.

Part of #8511.
2016-05-31 16:12:33 -07:00
Alex Eagle 3331321f64 build(ngc): run integration test hermetically
This ensures we run in a clean directory, using our real distribution. It finds bugs like @internal
APIs needed to type-check in the offline compiler, as well as problems in package.json.

Also move tsc-wrapped under tools/@angular
2016-05-27 17:21:35 -07:00
Alex Eagle c6064a30a1 chore(package.json): make the packages installable 2016-05-27 17:21:34 -07:00
Martin Probst 040b101842 feat(security): complete DOM security schema.
This addresses several oversights in assigning security contexts to DOM schema
elements found by our security reviewers (thanks!).

This also adds some more precise unit tests for the interaction between
(Dom)ElementSchemaRegistry and the TemplateParser, and extracts the security
specific parts into dom_security_schema.ts.

Comparison of (potentially) dangerous property names is done case insensitive,
to avoid issues like formAction vs formaction.

Part of issue #8511.
2016-05-27 11:47:33 -07:00
Phong Huynh ec198b0dc6 docs(MockConnection) add mockError usage example (#8888) 2016-05-27 10:10:53 -07:00
Alex Eagle b5d14c26d2 chore(lint): enable requireInternalWithUnderscore tslint check 2016-05-27 09:31:18 -07:00
Alex Eagle 2019050db2 chore(lint): enable duplicateModuleImport tslint check 2016-05-27 09:17:08 -07:00
Victor Berchet 307d105d2c fix(DomRegistry): fix svg support 2016-05-26 16:46:00 -07:00
Alex Eagle 0b6967fd74 chore(lint): fix missing semicolon to make Circle green (#8877) 2016-05-26 16:43:15 -07:00
Alex Eagle ef0c32512c chore(lint): enable semicolon and variable-name tslint checks 2016-05-26 15:46:03 -07:00
Victor Berchet 4d825dd9fd refactor(intl facade): remove outdated code 2016-05-26 14:19:26 -07:00
Tobias Bosch 8e38291156 chore: enable the compiler_cli tests again.
Closes #8864
2016-05-26 13:33:26 -07:00
laco0416 f93512bf27 feat(ViewEncapsulation): default ViewEncapsulation to configurable
BREAKING CHANGES:

DirectiveNormalizer takes new constructor arguments, `config:CompilerConfig`.

Closes #7883
2016-05-26 13:23:37 -07:00
Suguru Inatomi c3fafa0651 feat(change_detection): make INTERPOLATE_REGEXP customizable (#7417)
BREAKING CHANGES:

`Parser` constructor required new parameter `config: CompilerConfig` as second argument.
2016-05-26 13:08:39 -07:00
Andrii Nechytailov 9036f78b74 fix(compiler): throw an error if variable with the same name is already defined. (#7209)
* fix(compiler): throw an error if variable with the same name is already defined. Closes #6492

* fix(compiler): Clean up formatting for issue #6492

* fix(compiler): throw an error if reference with the same name is already defined.

Closes #6492
2016-05-26 13:04:17 -07:00
Andrei Tserakhau 324f0147f6 feat(common/datePipe): change date formatter to use correct pattern closes #7008 (#8154)
- add regular expression to parse date parts
- add date part creator function
- replace tokens in pattern to parsed parts
2016-05-26 12:06:29 -07:00
Jon be48ba1b06 fix(ngRouteShim): update anchors to function similar to angular 1.x (#8478)
* fix(ngRouteShim): update anchors to function similar to angular 1.x when setting the target

* fix(ngRouteShim): update anchor target check to use indexOf instead of contains on array
2016-05-26 12:03:23 -07:00
Dimitrios Loukadakis b2a7fd05cb fix(router): replace state when path is equal to current path (#8766)
Same as 2bf21e1747 but for new router.

This also fixes an issue where when application loads it clears forward history
because Router constructor calls navigateByUrl which was causing a push state to happen.
2016-05-26 12:02:24 -07:00
Nicholas Hydock 84f859d7b2 fix(Control): Support <select multiple> with Control class (#8069) 2016-05-26 12:01:49 -07:00
Matthew Windwer cbc8d0adf8 fix(upgrade): Ensure upgrade adapter works on angular.js 1.2 (#8647) 2016-05-26 11:58:47 -07:00
Anton Moiseev 420e83a396 feat(forms): add the submitted flag to NgForm and NgFormModel directives
Closes #2960

Closes #7449
2016-05-26 10:48:13 -07:00
Thierry Templier 89f61087c7 feat(http): implement Response.prototype.toString() to make for a nicer error message
Added a toString method to the Response class displaying status / status and
the URL of the request.

Closes: https://github.com/angular/http/issues/89

Closes #7511
2016-05-26 10:38:29 -07:00
Matt Wheatley b7b56785d1 fix(Renderer): update signatures to make RenderDebugInfo optional
The code does not force the user to provider `RenderDebugInfo`. The
current implementation lists this as a mandatory parameter. Update
the parameter to be optional.

Fixes #8466

Closes #8859
2016-05-26 10:32:03 -07:00
Zach Bjornson 3a62023260 docs(LifecycleHooks): correct ngDoCheck description (#8807)
The current behavior is for ngDoCheck to supplement, not override, the default change detector. OnChanges will still be called when DoCheck is implemented (fixes #7307).
2016-05-26 10:27:42 -07:00
Dimitrios Loukadakis fa2ce8100b fix(router): openning links in new tab
Clicks on router-link should not prevent browser default action when
any mouse button other than left mouse button or ctrl/meta key is pressed.

router-link href should use location strategy external url.

Closes #5908
Closes #6806
Closes #7749
Closes #8806

Closes #8821
2016-05-26 10:26:57 -07:00
Victor Berchet 172a5663ef feat(platform-browser-dynamic): re-add a deprecated platform-browser-dynamic 2016-05-26 10:22:39 -07:00
Victor Berchet f4b972815b fix(platform-browser): fix rollup config 2016-05-26 10:21:24 -07:00
Julie Ralph 0cb93a436d fix(testing): add discardPeriodicTasks to be used with fakeAsync (#8629)
Closes #8616
2016-05-26 10:19:30 -07:00
Suguru Inatomi b2e804c961 fix(metadata): Allow spacing in multiple selectors (#7418) 2016-05-26 10:18:31 -07:00
Igor Minar 85ce184197 refactor(compiler): remove obsolete code (#8837) 2016-05-26 10:15:47 -07:00
Victor Berchet 29c77df4be fix(playground): fix WebWorker single_thread example 2016-05-26 09:58:40 -07:00
Ajay Ambre c27bc1956b docs(API): correct formatting of EmbeddedViewRef API doc example (#8584)
remove ... from EmbeddedViewRef API example doc comments
2016-05-26 09:53:18 -07:00
Jonathan Miles 72707d80ab refactor(api): Correct public api variable names (#8552)
Correct public api variable names (ROUTER_DEPRETACED_TESTING -> ROUTER_DEPRECATED_TESTING)
2016-05-26 09:52:56 -07:00
Ivan Gabriele 00475f25c8 fix(doc): Add missing comma in example (#8769) 2016-05-26 09:50:59 -07:00
Vanga Sasidhar bab6023eee fix(router): Added pushState fallback for IE 9 browser.
Closes #6506

Closes #7929
2016-05-26 09:49:07 -07:00
Martin Probst 5e12a95789 test(security): test case for quoted URL values.
Test case that fixes #8701. This is already supported with the latest sanitizer
changes, but it's good to have an explicit test case.
2016-05-26 09:39:23 -07:00
Rob Wormald e5904f4089 fix(facade): change EventEmitter to be sync by default (#8761) 2016-05-26 09:34:04 -07:00
Victor Berchet 6da79673c2 test(e2e): workaround flaky e2e tests 2016-05-25 17:52:30 -07:00
Victor Berchet 352ee53202 Revert "feat(AsyncPipe): allow onError argument"
This reverts commit 390046d7b3.
CI fails for IE on win8.
PR #7990
2016-05-25 17:23:20 -07:00
Igor Minar b9347eb01c build: remove dependency on tsd and use @types/* instead 2016-05-25 16:42:28 -07:00
Igor Minar 4dbd8ed6b8 refactor: remove unnecessary annotations 2016-05-25 16:42:28 -07:00
Misko Hevery cb980d3e43 fix(ci): incorrect import 2016-05-25 16:22:55 -07:00
Misko Hevery d0a64f9c86 fix: broken build 2016-05-25 16:03:11 -07:00
Alex Eagle 16ef21d086 fix(ngc): depend on correct tsc-wrapped package 2016-05-25 15:34:43 -07:00
Miško Hevery 39ecd01b86 chore: audit @angular/core API classification (#8808) 2016-05-25 15:00:05 -07:00
Matias Niemelä 5e0f8cf3f0 feat(core): introduce support for animations
Closes #8734
2016-05-25 13:56:50 -07:00
Alex Eagle 4c26397937 chore(ngc): refactor out tsc-wrapped
This allows angular's build to depend on some extensions, but not on code generation, and breaks a cycle in the angular build
We now merge ts-metadata-collector into tsc-wrapped and stop publishing the former.
2016-05-25 09:45:55 -07:00
Igor Minar 2ab1085dfb fix(core): remove @internal annotation from PLATFORM_CORE_PROVIDERS
This symbol is no longer reexported at the top level, so it's safe to not mark it as internal.

This fixes the offline compilation which got broken by this symbol not being present in the d.ts
files when the compiler tries to do a deep import.

Closes #8819
2016-05-25 08:22:07 -07:00
Igor Minar 16dfe3c63f build: consolidate tsc to ease migration to @types/ based typings delivery
I actually tried to use @types/* directly but came across several issues which prevented me
from switching over:
- https://github.com/Microsoft/TypeScript/issues/8715
- https://github.com/Microsoft/TypeScript/issues/8723
2016-05-25 08:22:07 -07:00
Wesley Cho 53628e19ac fix(compiler): add ability to parse : in * directives
- Add ability to parse bindings properly when `:` is present when using a directive with the `*` prefix

Closes #6038
2016-05-24 21:43:10 -07:00
Misko Hevery 62dd3ceb64 Revert "Don't update the location during initial router navigation"
This reverts commit d5066a9a0f.
2016-05-24 21:43:10 -07:00
Jay Phelps d5066a9a0f Don't update the location during initial router navigation
Closes #6069
2016-05-24 21:34:59 -07:00
Alfonso Presa 5f3d02bc7c fix(Animation): Problem decimals using commas as decimal separation
Tests where failing due to `.` character being used as decimal separator in some regional settings (like spanish for example)

Closes #6335

Closes #6338
2016-05-24 21:23:46 -07:00
Utsav Shah 92340350d2 fix(http): Set response.ok
The ok property was not being set on response objects.
It's now set based on the status code.

Closes #6390
Closes #6503
2016-05-24 21:20:27 -07:00
gdi2290 d4827caa08 refactor(DomRootRenderer): allow registeredComponents access
Closes #6584
2016-05-24 21:17:11 -07:00
Gabe Scholz 6ce13b68fa Typo in web_workers.md
Closes #6694
2016-05-24 21:16:11 -07:00
Borys Semerenko e82b700ad0 docs(directives): add a deprecation comment for properties, events
Closes #7059
2016-05-24 21:13:56 -07:00
Grégory Bataille 60a2ba87d4 fix(#7099): support for comment finishing with multiple dashes
<!-- xxxx ------->

The issue came from a lack of support for backtracking on string
matching.
The way it is done, if the "end pattern" for consumeRawText starts with
twice the same character, you end up having problem when your string
being parsed has 3 times this char

Example
End string: xxyz
string to parse: aaaaaaxxxyz

calling consumeRawText(false, 'x', attemptParseStr('xyz')) would fail

Closes #7119
2016-05-24 21:01:41 -07:00
cexbrayat 83c19a1fbc fix(pipes): handle undefined value in slice
Closes #7152
2016-05-24 20:58:14 -07:00
Wassim Chegham 1513e201bb docs(ContentChild): add example with refs
Add missing example on how ContentChild works with refs
Closes #7160
Closes #7162
2016-05-24 20:57:25 -07:00
Dmytro Kulyk a38c9a1ef7 fix(Router) Fix detect active route in depth. 2016-05-24 20:51:51 -07:00
Misko Hevery d5f5ce82ca Revert "fix(compiler): support string tokens with `.` inside."
This reverts commit 67c80fbb5e.
2016-05-24 20:51:51 -07:00
Kara Erickson 6dc88f5b61 fix(forms): radio buttons with different names should not share state
Closes #7051
2016-05-24 20:07:57 -07:00
Kara Erickson 7a2ce7ff21 fix(forms): update accessor value when native select value changes
Closes #8710
2016-05-24 20:03:49 -07:00
Matias Niemelä 1ac38bd69a feat(renderer): add a `setElementStyles` method 2016-05-24 18:42:05 -07:00
Victor Berchet 390cefac72 refactor(testing/server): optimize imports 2016-05-24 14:00:00 -07:00
Thierry Templier 95af14b97c feat(http): added withCredentials support
Taken into account the withCredentials property within the request options:
- added corresponding property in the RequestOptions class
- added corresponding property in the Request class
- handle this property when merging options
- set the withCredentials property on the XHR object when specified

Added a test in the xhr_backend_spec.ts to check that the property is actually
set on the XHR object

Closes https://github.com/angular/http/issues/65

Closes #7281

Closes #7281
2016-05-24 11:53:43 -07:00
Thierry Templier 0f0a8ade7c feat(http): automatically set request Content-Type header based on body type
Implement the ability to provide objects as request body. The following use cases
are supported:
* raw objects: a JSON payload is created and the content type set to `application/json`
* text: the text is used as it is and no content type header is automatically added
* URLSearchParams: a form payload is created and the content type set to `application/x-www-form-urlencoded`
* FormData: the object is used as it is and no content type header is automatically added
* Blob: the object is used as it is and the content type set with the value of its `type` property if any
* ArrayBuffer: the object is used as it is and no content type header is automatically added

Closes https://github.com/angular/http/issues/69

Closes #7310
2016-05-24 11:42:37 -07:00
Andreas Wissel 016f0d8e9e fix: Typo in async.ts
Closes #7382
2016-05-24 11:15:51 -07:00
Victor Berchet 3e5716ec16 feat(i18n): support implicit tags/attributes 2016-05-24 10:12:19 -07:00
Victor Berchet 75e6dfb9ab fix(browser): platform code cleanup 2016-05-23 17:57:28 -07:00
Victor Berchet f95a604b59 fix(bootstrap): swap coreBootstrap() and coreLoadAndBootstrap() arguments 2016-05-23 17:57:28 -07:00
Victor Berchet 3ff20cd7e3 fix(core): fix build 2016-05-23 17:56:48 -07:00
Kevin-K 17f73cb7bc docs(http): fix MockBackend example
imports & syntax error fix

Closes #7383
2016-05-23 17:22:36 -07:00
Brendan Wyse fba0e2ff12 docs(browser.ts): update bootstrap injector override argument name
Closes #7387
2016-05-23 17:21:07 -07:00
Vamsi V b62415c962 refactor(chore): remove unused mapToObject and objectToMap methods from serializer
resolves #7402

Closes #7416
2016-05-23 17:20:25 -07:00
Tom Schoener adc135e6c8 refactor(async_pipe): use subscription strategy interface
The strategies for Promise and Observable based subscriptions
have (nearly) the same method signatures. They should implement
a common interface.

Closes #7573
2016-05-23 17:02:56 -07:00
Tero Parviainen ceac045a7f fix(compiler): have CSS parser support nested parentheses inside functions
Closes #7580
2016-05-23 16:58:15 -07:00
Ward Bell 0a872ffd38 feat(core/linker): add SimpleChanges type to lifecycle_hooks to simplify OnChanges signature
Closes #8557
2016-05-23 16:11:52 -07:00
Pete Boere 6f3a6a55a0 Update url_search_params.ts
Values need to be encoded on `toString()`
Closes #7686
2016-05-23 14:43:26 -07:00
Vamsi Varikuti 0795dd307b refactor(chore): Replace all 'bindings' with 'providers'
BREAKING CHANGE

Deprecated `bindings:` and `viewBindings:` are replaced with
`providers:` and `viewProviders:`

Closes #7687
2016-05-23 13:31:08 -07:00
Vamsi Varikuti 49fb7ef421 refactor(router): Remove deprecated 'as' from ‘RouteConfig’
BREAKING CHANGE
Remove deprecated 'as' from ‘RouteConfig’ in favour of ‘name’
2016-05-23 13:24:36 -07:00
Peter Bacon Darwin cbeeff2bd6 fix(Router): do not kill event-emitter on navigation failure
Closes #7692
Closes #7532

Closes #7692
2016-05-23 13:21:09 -07:00
Sebastian Hillig ce013a3dd9 feat(regex_url_paths): add `regex_group_names` to handle consistency with serializers
By adding `regex_named_groups` to regex route configurations we can consistently map
regex matching groups to component parameters.

This should fix #7554.

Closes #7694
2016-05-23 13:18:21 -07:00
Justin DuJardin c43636f2bb fix(di): type error in InvalidProviderError
- when trying to instantiate an injector with an unknown provider
Closes #7729
2016-05-23 13:08:10 -07:00
cjc343 9c2fe660a3 (docs) Fix pony greeting equivalence
Cheatsheet claims equivalence between two statements which are not equivalent
Closes #7761
2016-05-23 13:07:20 -07:00
laco0416 abc266fa35 feat(common): DatePipe supports ISO string
Closes #7794
2016-05-23 12:30:02 -07:00
kurt 7d853dd9ad fix(router): ensuring MatchedUrl pass query params 2016-05-23 12:24:08 -07:00
Alex Eagle 666dc75c15 chore(lint): disallow duplicate imports from a module
Closes #7859
2016-05-20 15:59:33 -07:00
Pete Mertz 830aecd1a7 fix(router/parsing): change route rule error to say PascalCase instead of CamelCase
Closes #7874
2016-05-20 15:39:30 -07:00
Rene Weber 2bf21e1747 fix(Router): replace state when normalized path is equal to current normalized path
Make sure the same path is not added multiple times to the history.
It is replacing the state, instead of skipping it completely,
because the current path in the browser might not be normalized,
while the given one is normalized.

Closes #7829

Closes #7897
2016-05-20 15:30:15 -07:00
Pascal Precht 9105ab9596 docs(ng_control_group): update API docs syntax
Closes #7357
2016-05-20 13:19:08 -07:00
mgechev 165357bfa3 refactor(forms): remove useless imports
Remove useless imports and change `bindings` to `providers` inside
`@Component` and `@Directive`.

Closes #7904
2016-05-20 13:13:27 -07:00
Andrew 33c7f74cb9 style(platform/browser): fix type spacing
Closes #7980
2016-05-20 13:05:40 -07:00
alexcastillo cb84cbf545 feat(shadow_css): add encapsulation support for CSS @supports at-rule
Closes #7944
2016-05-20 13:02:24 -07:00
Elliott Davis b2e0946696 fix(Request): Change Request.text's return type to string
Change the return typing for the .text method to `string` so typescript treats it
like a normal string.

Closes #8138
2016-05-20 12:57:31 -07:00
Tobias Bosch 67c80fbb5e fix(compiler): support string tokens with `.` inside.
Closes #8178
2016-05-20 12:56:02 -07:00
Igor Minar 9175a049d3 feat: add minified bundles
BREAKING CHANGE: bundles are now in the bundles/ subdirectory within each package
2016-05-20 11:00:49 -07:00
Igor Minar 0035575c82 build: turn on tsc's stripInternal when producint public d.ts file
I also made some changes to fix imports and remove some stuff that caused
breakage once stripInternals was turned on.
2016-05-20 10:59:57 -07:00
Drew Moore 1bff47f97d docs: fix syntax errors in HostBinding metadata example
add missing parentheses to getters, remove erroneous brackets in HostBindings

Closes #8269
2016-05-20 10:56:11 -07:00
Victor Berchet e8e61de28d refactor(WebWorker): move XHR worker side 2016-05-20 10:48:55 -07:00
Victor Berchet 54f8308999 refactor(browser): merge static & dynamic platforms 2016-05-20 10:48:55 -07:00
PatrickJS 6c99746f0b Update tools.ts
Closes #8296
2016-05-20 10:12:54 -07:00
PatrickJS 4086b49046 feat(enableDebugTools): return ComponentRef
allows for 
```
bootstrap(App, [
  ...HTTP_PROVIDERS,
  ...ROUTER_PROVIDERS
])
.then(enableDebugTools)
```
without breaking the rule of always returning a value in a promise
2016-05-20 10:12:54 -07:00
PatrickJS efe4633b15 refactor(empty.ts): typo (#8398)
emppty -> empty
2016-05-20 10:02:47 -07:00
Jake Garelick 19e65382f7 fix(core): accurate dev mode message for dart (#8403) 2016-05-20 10:01:39 -07:00
Yang Lin c6f2b3e96b docs(router): fix import and replace RouteConfig (#8433) 2016-05-20 10:00:04 -07:00
mgechev 55921be1af fix(router-deprecated): export RootRoute
Fix #8449

Closes #8450
2016-05-20 09:59:21 -07:00
David Reher 9b1b5b393d fix(angular1_router): ngLink should not throw an error if routeParams are undefined (#8460)
If routeParams are undefined, no href attribute should be rendered. This matches the behaviour of ngHref.
2016-05-20 09:48:03 -07:00
agpreynolds 3857c8226e docs(MockConnection) update mockRespond usage example (#8487)
Closes: #8486
2016-05-20 09:19:59 -07:00
Dimitrios Loukadakis 595bcdd1ac fix(router): browser back and forward buttons not working correctly.
Closes #8524

Closes #8532
2016-05-19 22:42:08 -07:00
Rob Wormald aec95015f8 docs(http): update http docs to mention .map operator
Closes #5947
2016-05-19 22:15:26 -07:00
Fabian Raetz 90af4763d8 fix(angular1_router): delay view update until activate promise gets fullfilled
If the $routerOnActivate hook returns a promise, the navigation
is commited, once the promise gets fullfilled but the view
is updated immediately.

This commit delays the view update so that both (view and url) are
updated at the same time.

Closes #7777
2016-05-19 20:42:06 -07:00
gdi2290 390046d7b3 feat(AsyncPipe): allow onError argument
Closes #7990
2016-05-19 16:49:28 -07:00
PatrickJS 587c119c75 feat(NgZone): isStable
Closes #8108
2016-05-19 16:10:08 -07:00
Aliaksei Palkanau 3019140e7e feat(http): set the statusText property from the XMLHttpRequest instance
Closes #4162
2016-05-19 15:58:59 -07:00
BeastCode 7a80f0d1e1 change property and event to use camel case
Closes #6580
2016-05-19 15:21:54 -07:00
BeastCode 0894318f50 change property and event to use camel case:
* some-property -> someProperty
* some-event -> someEvent

Closes #6609
2016-05-19 15:20:34 -07:00
William Welling 9019c6f937 Condition using component as well.
Closes #7755
2016-05-19 15:15:25 -07:00
William Welling 166b73f4f3 Condition using urlPath, component is null on UnresolvedException of child AsyncRoute. 2016-05-19 15:15:25 -07:00
Sekib Omazic cb94111f18 style(Forms): remove unused imports
remove unused imports from the forms package
2016-05-19 14:50:33 -07:00
Kai Ruhnau a88b887a05 docs(cheatsheet): Document SVG idiosyncrasies (#6055) 2016-05-19 10:20:08 -07:00
Victor Berchet 6e62217b78 fix(WebWorker): remove the platform-browser dependency on compiler 2016-05-18 16:23:09 -07:00
Joost de Vries a01a54c180 adds 'repository' metadata to npm modules (#8649) 2016-05-17 23:17:15 -07:00
Hannah Howard db8290632f fix(upgrade): fallback to root ng2 injector when element is compiled outside the document (#8684)
Currently downgraded ng2 elements fail inside a ui-router view because they are unable
to require an ng2 Injector via the require attribute of the DDO, because ui-router compiles
its templates before they are inserted in a ui-view. This adds a "fallback" behavior if
a parent injector cannot be found to go to the root ng2 Injector.
2016-05-17 15:55:53 -07:00
Hannah Howard 6cdc53c497 fix(UpgradeNg1ComponentAdapter): make bindings available on $scope in controller & link function (#8645)
Delays NG1 Directive controller instatiation where possible and pre-link function always
to the ngOnInit() lifecycle hook. This way bindings are always available on $scope in both
the controller and the link function.
2016-05-17 14:53:59 -07:00
Martin Probst 15ae710d22 feat(security): allow url(...) style values.
Allows sanitized URLs for CSS properties. These can be abused for information
leakage, but only if the CSS rules are already set up to allow for it. That is,
an attacker cannot cause information leakage without controlling the style rules
present, or a very particular setup.

Fixes #8514.
2016-05-17 11:23:31 +02:00
Martin Probst dd50124254 feat(security): allow data: URLs for images and videos.
Allows known-to-be-safe media types in data URIs.

Part of #8511.
2016-05-17 10:57:14 +02:00
Tobias Bosch ff36b0384a fix(compiler_cli): normalize used directives
- e.g. needed for content projection.

Closes #8677
2016-05-16 13:07:13 -07:00
Martin Probst 50c9bed630 feat(security): expose the safe value types.
This allows users to properly type their `SafeHtml`, `SafeStyle`, etc values.

Fixes #8568.
2016-05-15 11:47:06 +02:00
Martin Probst 8b1b427195 feat(security): support transform CSS functions for sanitization.
Fixes part of #8514.
2016-05-14 13:25:45 +02:00
Vikram Subramanian 9a05ca95f6 fix(build): Release compiler_cli packages along with rest of @angular packages and use ANGULAR_VERSION for package version and peer dependencies. 2016-05-13 13:35:10 -07:00
Marc Laval 61b339678d test(compiler): test schema generation only in Chrome
Closes #8581
2016-05-11 17:01:26 -07:00
Alex Eagle 817ddfa847 fix(compiler): allow --noImplicitAny 2016-05-11 16:56:12 -07:00
Alex Eagle c1154b30c7 fix(compiler): allow decorators defined in the same file 2016-05-11 16:56:12 -07:00
Alex Eagle 0d71345b93 fix(codegen): codegen all files in the program, not just roots
fixes #8475
2016-05-11 16:56:12 -07:00
Alex Eagle 9e3df8eefe chore(tsickle): remove redundant jsdoc types
tsickle doesn't like them, and anyway they are bound to get out-of-sync with the inline TS types
2016-05-10 17:38:10 +02:00
Martin Probst 3e68b7eb1f feat(security): warn users when sanitizing in dev mode.
This should help developers to figure out what's going on when the sanitizer
strips some input.

Fixes #8522.
2016-05-09 16:46:31 +02:00
Matias Niemelä 9fbafba993 chore(parsing): change internal usage of `@` to `:` for namespaced values
Closes #8346
2016-05-09 16:20:32 +02:00
Martin Probst 7a524e3deb feat(security): add tests for URL sanitization. 2016-05-09 16:00:24 +02:00
Martin Probst 7b6c4d5acc feat(security): add tests for style sanitisation. 2016-05-09 16:00:24 +02:00
Martin Probst f86edae9f3 feat(security): add an HTML sanitizer.
This is based on Angular 1's implementation, parsing an HTML document
into an inert DOM Document implementation, and then serializing only
specifically whitelisted elements.

It currently does not support SVG sanitization, all SVG elements are
rejected.

If available, the sanitizer uses the `<template>` HTML element as an
inert container.

Sanitization works client and server-side.

Reviewers: rjamet, tbosch , molnarg , koto

Differential Revision: https://reviews.angular.io/D108
2016-05-09 16:00:24 +02:00
Martin Probst df1b1f6957 feat(security): strip XSSI prefix from XHR responses. 2016-05-05 14:25:44 -07:00
Martin Probst 9099160038 chore: fix comment indent. 2016-05-05 12:46:07 -07:00
Martin Probst 67ed2e2c0a feat(security): fill in missing security contexts.
Reviewers: koto, rjamet, molnarg

Differential Revision: https://reviews.angular.io/D109
2016-05-04 19:28:50 -07:00
Tobias Bosch 6d36a7a45f chore: fix unit tests on node.js
Closes #8476
2016-05-04 18:00:29 -07:00
Tobias Bosch e2b1e1577d fix(core): don’t detach nested view containers when destroying a view
When a view is destroyed, we destroy all
views in view containers and should not detach them. However, previously, we also detached them which lead to problems during the iteration loop.

Closes #8458
Closes #8471

Introduced by 0c600cf6e3
2016-05-04 16:27:20 -07:00
vsavkin b30ddfbfc5 chore(router): clang-format 2016-05-04 15:01:27 -07:00
vsavkin abfb522f83 refactor(router): reuse existing segmentes when constructing new route trees 2016-05-04 14:51:04 -07:00
vsavkin b8136cc26e fix(router): provide a top-level route segment for injection 2016-05-04 14:51:04 -07:00
vsavkin d00b26d941 refactor(router): update link to reuse url segments when possible 2016-05-04 14:51:04 -07:00
vsavkin 12637a761c refactor(router): make names consistent 2016-05-04 14:50:00 -07:00
vsavkin 1a0aea67a0 feat(core): add a component resolver that can load components lazily using system.js 2016-05-04 14:50:00 -07:00
vsavkin 0f1465b899 feat(router): update router to support lazy loading 2016-05-04 14:50:00 -07:00
Tobias Bosch a81923b793 fix(compiler): emit correct types for literal arrays and maps. 2016-05-04 12:14:44 -07:00
Tobias Bosch 7150ace7c7 fix(compiler): support lifecycle hooks in compiler_cli 2016-05-04 12:14:43 -07:00
Tobias Bosch bdce154282 chore: add test script for compiler_cli 2016-05-04 12:14:43 -07:00
Tobias Bosch 5a84048f72 chore: adjust build for `tools/metadata` name change 2016-05-04 12:14:38 -07:00
Igor Minar 52595f52f9 chore: make workaround_empty_observable_list_diff @internal 2016-05-04 01:12:40 -06:00
Tobias Bosch edec158dd8 fix(compiler_cli): allow to use builtin directives like `NgIf`, …
Related to #8448
Closes #8454
2016-05-03 20:49:17 -07:00
Tobias Bosch 0297398f5e chore: clang-format master 2016-05-03 18:56:39 -07:00
Igor Minar 9485f5a813 fix: platform-server should declare it's dependency on parse5 via package.json 2016-05-03 18:07:52 -06:00
Tobias Bosch eba6e7946d refactor(compiler_cli): move it into modules/@angular and integrate properly into the build
This also does no more depend on a version
on npm for the compiler_cli.

Also runs the tests for tools/metadata
2016-05-03 15:57:49 -07:00
Igor Minar b600915953 build: add licensing preamble to umd bundles 2016-05-03 13:59:30 -06:00
Igor Minar 905f38acb8 build: fix source map paths for npm packages
the bundles have source mpas disabled for now because when we downlevel
the esm bundle to es5 tsc doesn't consider the original source map so
we end up with a source map pointing to the esm bundle instead which is
not useful.
2016-05-03 13:36:33 -06:00
Vikram Subramanian 509f4ec611 fix(testing): Check for pending macrotasks in ComponentFixture.whenStable() and ComponentFixture.isStable()
Closes #8389
2016-05-03 11:50:35 -07:00
Felix Itzenplitz 27a7b51d99 fix(docs): upgrade deprecated ngFor-Syntax 2016-05-03 11:49:33 -07:00
vsavkin b98c9e74e1 docs(router): add api docs 2016-05-03 11:35:07 -07:00
vsavkin 9f784dcc5a cleanup(router): fix e2e tests 2016-05-03 10:25:44 -07:00
vsavkin b625f2471a feat(router): make RouterLink accept single values 2016-05-03 10:25:44 -07:00
vsavkin 3aa2606ff1 cleanup(router): make names consistent 2016-05-03 10:25:44 -07:00
vsavkin 89704e0f93 fix(router): add support for ../ 2016-05-03 10:25:44 -07:00
Martin Probst 908a102a87 feat: security implementation in Angular 2.
Summary:
This adds basic security hooks to Angular 2.

* `SecurityContext` is a private API between core, compiler, and
  platform-browser. `SecurityContext` communicates what context a value is used
  in across template parser, compiler, and sanitization at runtime.
* `SanitizationService` is the bare bones interface to sanitize values for a
  particular context.
* `SchemaElementRegistry.securityContext(tagName, attributeOrPropertyName)`
  determines the security context for an attribute or property (it turns out
  attributes and properties match for the purposes of sanitization).

Based on these hooks:

* `DomSchemaElementRegistry` decides what sanitization applies in a particular
  context.
* `DomSanitizationService` implements `SanitizationService` and adds *Safe
  Value*s, i.e. the ability to mark a value as safe and not requiring further
  sanitization.
* `url_sanitizer` and `style_sanitizer` sanitize URLs and Styles, respectively
  (surprise!).

`DomSanitizationService` is the default implementation bound for browser
applications, in the three contexts (browser rendering, web worker rendering,
server side rendering).

BREAKING CHANGES:
*** SECURITY WARNING ***
Angular 2 Release Candidates do not implement proper contextual escaping yet.
Make sure to correctly escape all values that go into the DOM.
*** SECURITY WARNING ***

Reviewers: IgorMinar

Differential Revision: https://reviews.angular.io/D103
2016-05-03 09:21:43 -07:00
Tobias Bosch dd6e0cf1b5 fix(compiler): fix where pipes live
Impure pipes need to live on the view
that used them and need a new instance for
each call site.

Impure pipes need to live on the component view, cached across all child views,
and need a new pure proxy for each for
each call site that lives on the view
of the call site.

Fixes #8408

This bug was introduced not long ago by 152a117d5c
2016-05-03 09:00:23 -07:00
Tobias Bosch 3a40cb1a85 fix(compiler): calculate the right moduleUrl 2016-05-02 22:36:32 -06:00
Tobias Bosch 00d3b6083c fix(compiler): support css stylesheets in offline compiler 2016-05-02 15:06:46 -07:00
Tobias Bosch 43527172ed chore: don’t shadow `tsconfig.json` used for editors by build specific tsconfig.json 2016-05-02 15:06:46 -07:00
Misko Hevery 107016ec12 chore: router move import changes 2016-05-02 13:27:03 -07:00
Miško Hevery d930ad1816 chore: router move-only 2016-05-02 13:27:03 -07:00
Igor Minar 2e1f3f003d build: adding basic e2e testing infrastructure 2016-05-02 08:15:10 -07:00
Tobias Bosch b6fd81169b feat(core): support the decorator data that tsickle produces 2016-05-01 23:40:59 -07:00
Alex Eagle 3ae856ab8b build(tsc): Use angular2-template-compiler in place of tsc
This lets us down-level Decorators with tsickle and produce .metadata.json
files for users to reference when offline-compiling their app.
2016-05-01 23:40:59 -07:00
Misko Hevery 3e17c99f4e chore: clang-reformat 2016-05-01 22:59:41 -07:00
Misko Hevery cd52318f48 fix: parse browser detection lazily 2016-05-01 22:27:55 -07:00
Misko Hevery 2570b72158 fix: textSelection on FireFox 2016-05-01 22:27:55 -07:00
Misko Hevery 6e79de794c fix: function name shim test 2016-05-01 22:27:55 -07:00
Alex Eagle c4be30d2e8 Revert "build(tsc): Use angular2-template-compiler in place of tsc"
This reverts commit 3d25294f706e0fd6224b20372be1e961959c0af8.
2016-05-01 20:51:00 -07:00
Alex Eagle 57240c85a5 build(tsc): Use angular2-template-compiler in place of tsc
This gives us tsickle pre-processing of Decorators, and produces
.metadata.json files for users to consume in their offline compilation.
2016-05-01 20:51:00 -07:00
Igor Minar a66cdb469f repackaging: all the repackaging changes squashed 2016-05-01 20:51:00 -07:00
Igor Minar 505da6c0a8 repackaging: all the file moves 2016-05-01 20:51:00 -07:00
vsavkin 4fe0f1fa65 feat(router): set router-link-active when RouterLink is active
Closes #8376
2016-05-02 01:03:22 +00:00
vsavkin ec4ca0eace feat(router): implements support for router-link-active 2016-05-02 01:03:22 +00:00
vsavkin ca13f1c024 fix(router): create a route tree when creating the router service
Closes #8365
2016-05-01 21:38:25 +00:00
vsavkin 277b1fc473 feat(router): add RouteTree and UrlTree as aliases to Tree<RouteSegment> and Tree<UrlSegment> 2016-05-01 21:38:25 +00:00
vsavkin 8836219b16 feat(router): add support for wildcards 2016-05-01 21:38:25 +00:00
Tobias Bosch f114d6c560 fix(compiler): fix cross view references and providers with `useValue`.
Before, we would create all fields in the generated views
with visibility `private`. This does not work if an embedded
view references a directive / element in a parent view.
In Dart, this was no problem so far as it does not have
a `private` modifier.

Before, `useValue` in a provider did not work when doing
offline compile, as so far the `MetadataResolver` was only
used for jit mode. Now, `useValue` supports any kind of value
that the static reflector can return. E.g. primitives,
arrays, string maps, …

Closes #8366
2016-05-01 02:30:33 +00:00
Tobias Bosch ab56be46e1 chore: move static_reflector into compiler_cli
Most of the bugs discovered so far in the offline compiler were related to the StaticReflector. As it was part of angular2 core, it was hard to update. Moving it into the compiler_cli allows to release more often until the compiler_cli gets more stable.

Note: Moving the unit test next to the sources is the simplest option for now in terms of build setup.

Note: This commit only does the move. The next commit updates the build to run it again.
2016-04-30 20:53:54 +00:00
Tobias Bosch 6a0cbb8a57 refactor(core): type `ComponentRef`, `ComponentFactory` and `ComponentFixture` by the component type
BREAKING CHANGE:
- `ComponetRef`, `ComponentFactory`, `ComponentFixture` now all require a type
  parameter with the component type.
Closes #8361
2016-04-30 19:47:54 +00:00
vsavkin 62a0809e81 feat(router): listen to location changes
Closes #8362
2016-04-30 19:02:14 +00:00
vsavkin 76d6f5fa0d fix(router): canDeactivate should not change the url when returns false
Closes #8360
2016-04-30 17:50:28 +00:00
Julie Ralph 0f1b370117 feat(tests): add ROUTER_FAKE_PROVIDERS to angular2/alt_router/router_testing_providers
This change adds providers for fake router dependecies.
This allows TestComponentBuilder to create components with RouterLink and RouterOutlet directives
without the test writer needing to override them.
2016-04-30 09:42:15 -07:00
Tobias Bosch 0f774df811 fix(compiler): project using the right directive as component.
Closes #8344
2016-04-29 18:30:30 -07:00
Tobias Bosch 351f24e8eb fix(core): return the ChangeDetectorRef of the component also for embedded views. 2016-04-29 18:30:30 -07:00
Tobias Bosch aecb60a604 refactor(core): use `Function.bind` for referring to event listeners instead of a closure. 2016-04-29 18:30:30 -07:00
Tobias Bosch 4d691b61ee fix(core): check components if an event handler inside of an embedded view fires.
BREAKING CHANGE:
- ViewRef.changeDetectorRef was removed as using ChangeDetectorRefs
  for EmbeddedViewRefs does not make sense. Use ComponentRef.changeDetectorRef
  or inject ChangeDetectorRef instead.

Fixes #8242
2016-04-29 18:30:29 -07:00
Tobias Bosch 11955f9b13 fix(compiler): support empty array and map literals.
This was broken after 152a117d5c

Fixes #8336
2016-04-29 18:30:29 -07:00
vsavkin deba804671 feat(router): add CanDeactivate 2016-04-29 18:05:06 -07:00
vsavkin e5b87e55da feat(router): implement relative navigation 2016-04-29 18:04:55 -07:00
Tobias Bosch 15f6b27ae0 refactor(compiler): support referenced `OpaqueToken`s correctly in offline compiler. 2016-04-29 16:53:51 -07:00
Martin Probst 176e55927c refactor(compiler): support hash syntax for providers. 2016-04-29 16:53:50 -07:00
Martin Probst 365be6a309 chore: clang-format after various changes. 2016-04-29 16:53:50 -07:00
Martin Probst 713e6d4aff chore: adjust router to /*@ts2dart...*/ 2016-04-29 16:53:50 -07:00
Misko Hevery a8e277b067 chore: remove const Provider() in favor of /* @ts2dart_Provider */ {provide:} 2016-04-29 16:53:50 -07:00
Misko Hevery 3aa322a9c6 chore: replace @CONST() with /*@ts2dart_const*/ 2016-04-29 16:53:50 -07:00
Misko Hevery a02614beaa chore: replace CONST_EXPR with /*@ts2dart_const*/ 2016-04-29 16:53:49 -07:00
Misko Hevery d2527b504a chore: upgrade to ts2dart@0.9.9 2016-04-29 16:53:49 -07:00
Misko Hevery 46cd868827 feat(di): support map literals as providers 2016-04-29 16:53:49 -07:00
Tobias Bosch b1a9e445b3 fix(perf): don’t use `try/catch` in production mode
The previous code that had `try/catch` statements in methods could not be optimized by Chrome. 

This change separates `AppView` (no `try/catch`) form `DebugAppView` (always `try/catch`). Our codegen will use `AppView` in production mode and `DebugAppView` in debug mode.

Closes #8338
2016-04-29 10:18:57 -07:00
Tobias Bosch 5297c9d9cc refactor(core): deprecate `DynamicComponentLoader` and `DebugNode.inject`
BREAKING CHANGE:
- `DynamicComponentLoader` is deprecated. Use `ComponentResolver` and `ViewContainerRef` directly.
- `DebugNode.inject` is deprecated. use `DebugNode.injector.get` instead.
2016-04-29 01:37:58 -07:00
Tobias Bosch ee7caceec7 Revert "docs: deprecate `DynamicComponentLoader` and `DebugNode.inject`"
This reverts commit a0b5964a63.
2016-04-29 01:36:58 -07:00
Tobias Bosch a0b5964a63 docs: deprecate `DynamicComponentLoader` and `DebugNode.inject` 2016-04-29 01:34:06 -07:00
Tobias Bosch cacdead96d feat(core): introduce template context
BREAKING CHANGE:
- Before, a `EmbeddedViewRef` used to have methods for 
  setting variables. Now, a user has to pass in a context
  object that represents all variables when an `EmbeddedViewRef`
  should be created.
- `ViewContainerRef.createEmbeddedViewRef` now takes
   a context object as 2nd argument.
- `EmbeddedViewRef.setLocal` and `getLocal` have been removed.
  Use `EmbeddedViewRef.context` to access the context.
- `DebugNode.locals` has been removed. Use the new methods `DebugElement.references`
  to get the references that are present on this element,
  or `DebugElement.context` to get the context of the `EmbeddedViewRef` or the component to which the element belongs.

Closes #8321
2016-04-29 01:22:13 -07:00
Alex Eagle 96ae348648 chore(build): fix formatting and tests
Closes #8098
2016-04-28 23:59:06 -07:00
Alex Eagle c493d88405 chore(compiler): refactoring for offline compiler cli
- pass a baseUrl for asset resolution from static symbols
- fixes in StaticReflector to work with a path-aware host

see #7483
2016-04-28 21:54:02 -07:00
Alex Eagle 8bf6ef6544 fix(metadata): expose Providers in metadata
These worked in Dart because they were effectively exported even without the export keyword.
Without exporting these symbols, they are not produced in .metadata.json files, which leaves
dangling references from the Decorators that use them.
2016-04-28 21:31:28 -07:00
Alex Eagle ca40ef5ac7 fix(codegen): event handler has boolean return type 2016-04-28 21:31:28 -07:00
vsavkin 30de2db349 cleanup(router): make analyzer happy
Closes #8220
2016-04-29 02:45:57 +00:00
vsavkin 602641dffd feat(router): adds an example app using the new router 2016-04-29 02:45:57 +00:00
vsavkin 560cc14d97 feat(router): change location when navigating 2016-04-29 02:45:57 +00:00
vsavkin de56dd5f30 feat(router): add RouterLink 2016-04-29 02:45:57 +00:00
vsavkin fa5bfe4b64 feat(router): add link that support only absolute urls 2016-04-29 02:45:57 +00:00
vsavkin 446657bdd5 feat(router): update recognize to handle matrix parameters 2016-04-29 02:45:57 +00:00
vsavkin 79830f1c75 feat(router): add RouterUrlSerializer 2016-04-29 02:45:57 +00:00
vsavkin 6e1fed42b7 feat(router): add Router and RouterOutlet to support aux routes 2016-04-29 02:45:57 +00:00
vsavkin d35c109cb9 feat(router): update recognize to support aux routes 2016-04-29 02:45:57 +00:00
vsavkin fad3b6434c feat(router): update url parser to handle aux routes 2016-04-29 02:45:57 +00:00
Alex Eagle 70b23ae2ca refactor(compiler): make static reflector work
Also adjust `RuntimeMetadataResolver` to
be able to use it. 

Also rename `RuntimeMetadataResolver` into `CompileMetadataResolver`.
Closes #8313
2016-04-28 23:06:17 +00:00
Vikram Subramanian 769835e53e feat(testing): Use NgZone in TestComponentBuilder.
Instantiating the test component within an NgZone will let us track async tasks in event handlers and change detection.

We can also do auto change detection when triggering events through dispatchEvent and not have to do fixture.detectChange() manually in the test.

New API:
ComponentFixture.autoDetectChanges() - This puts the fixture in auto detect mode that automatically calls detectChanges when the microtask queue is empty (Similar to how change detection is triggered in an actual application).

ComponentFixture.isStable() - This returns a boolean whether the fixture is currently stable or has some async tasks that need to be completed.

ComponentFixture.whenStable() - This returns a promise that is resolved when the fixture is stable after all async tasks are complete.

Closes #8301
2016-04-28 22:37:37 +00:00
Vikram Subramanian ac55e1e27b fix(build): Resolve Dart analyzer issues with the Dart dev channel
Closes #8316
2016-04-28 20:35:56 +00:00
Alex Eagle d9648887b8 fix(metadata): Do not attach module names to metadata.
The filename contains the module name as resolved by users, so the top-level module name is uneeded.
Module names on references are replaced by capturing the import syntax from the module.
This allows readers of the metadata to do the module resolution themselves.

Fixes #8225
Fixes #8082

Closes #8256
2016-04-28 01:58:13 +00:00
Vikram Subramanian 35cd0ded22 chore(testing): Refactor test methods to have a uniform interface.
Remove FunctionWithParamTokens.

All test wrappers async, fakeAsync and inject now return just a Function instead of FunctionWithParamTokens. This makes them directly consumable by the test framework. Also the test framework code does not have to handle a union of Function and FunctionWithParamTokens everywhere.

The Function returned by the above methods are considered asynchronous by the test framework if they return a Promise, synchronous otherwise.

Closes #8257
2016-04-28 01:16:25 +00:00
Tobias Bosch d2efac18ed feat(core): separate refs from vars.
Introduces `ref-` to give a name to an element or a directive (also works for `<template>` elements), and `let-` to introduce an input variable for a `<template>` element.

BREAKING CHANGE:
- `#...` now always means `ref-`.
- `<template #abc>` now defines a reference to the TemplateRef, instead of an input variable used inside of the template.
- `#...` inside of a *ngIf, … directives is deprecated.
  Use `let …` instead.
- `var-...` is deprecated. Replace with `let-...` for `<template>` elements and `ref-` for non `<template>` elements.

Closes #7158

Closes #8264
2016-04-28 01:13:40 +00:00
Julie Ralph ff2ae7a2e1 fix(testing): allow test component builder to override directives from lists
When a component uses a list of directives, such as `ROUTER_DIRECTIVES`,
make `TestComponentBuilder#overrideDirective` work properly for members
of the list.

Closes #7397

Closes #8217
2016-04-28 00:56:45 +00:00
Hans Larsen e1058a4d8a Revert "feat(compiler): ElementSchema now has explicit DOM schema information"
This reverts commit d327ac4b43.
2016-04-27 17:41:57 -07:00
Misko Hevery d327ac4b43 feat(compiler): ElementSchema now has explicit DOM schema information
This makes the schema available for offline compile compiler as well.

Closes #8179
2016-04-27 22:57:28 +00:00
Pawel Kozlowski 1ad2a02b11 fix(core): properly evaluate expressions with conditional and boolean operators
Fixes #8235
Fixes #8244

Closes #8282
2016-04-27 21:25:50 +00:00
Tobias Bosch 1e8864c4a5 fix(compiler): Allow templates to access variables that are declared afterwards.
Fixes #8261
2016-04-27 11:22:44 -07:00
Alex Castillo 7d1b6af073 style(global): group multiple imports from same module
Closes #7802

Closes #8209
2016-04-26 22:40:30 +00:00
Jeff Cross b62bccf254 build(npm): update rxjs to 5.0.0-beta.6
Closes #6871
Closes #8047
2016-04-26 21:16:37 +00:00
vsavkin 5a897cf299 feat(router): add Router and RouterOutlet
Closes #8173
2016-04-25 22:41:33 +00:00
vsavkin ef67a0c57f feat(router): add router metadata 2016-04-25 22:41:33 +00:00
vsavkin ef6163e652 feat(router): implement recognizer 2016-04-25 22:41:33 +00:00
vsavkin f6985671dd feat(router): implement RouterUrlParser 2016-04-25 22:41:33 +00:00
vsavkin 90a1f7d5c4 feat(router): add UrlSegment, RouteSegment, and Tree 2016-04-25 22:41:33 +00:00
Alex Eagle 3e114227f8 refactor(core): support importUri in StaticReflector
Closes #8195
2016-04-25 22:14:29 +00:00
Foxandxss b48d907697 docs(template-syntax): rename elvis operator
Closes #8196
2016-04-25 21:26:33 +00:00
Felix Itzenplitz 676ddfa065 docs(cheatsheet): add Directive to cheatsheet
Closes #8170
2016-04-25 20:41:34 +00:00
Alex Eagle c8d00dc191 fix(codegen): add explicit any to class fields
fixes #8204

Closes #8205
2016-04-25 20:21:18 +00:00
Misko Hevery 0b6865d6c6 chore: Remove AngularEntrypoint from TS
Closes #8158
2016-04-25 17:35:05 +00:00
Tobias Bosch 67d05eb65f fix(compiler): use DI order for change detection order.
Closes #8198
2016-04-25 09:36:46 -07:00
Tobias Bosch 152a117d5c fix(compiler): properly implement pure pipes and change pipe syntax
Pure pipes as well as arrays and maps are
implemented via proxy functions. This is
faster than the previous implementation
and also generates less code.

BREAKING CHANGE:
- pipes now take a variable number of arguments, and not an array that contains all arguments.
2016-04-25 09:04:22 -07:00
Tobias Bosch d6626309fd Revert "fix(compiler): only call pure pipes if their input changed."
This reverts commit 8db62151d2.
2016-04-25 07:53:49 -07:00
Kara Erickson c3daccd83b fix(forms): ensure select model updates in firefox and ie
Closes #6573

Closes #8148
2016-04-22 21:23:20 +00:00
Tobias Bosch 8db62151d2 fix(compiler): only call pure pipes if their input changed. 2016-04-21 16:20:19 -07:00
Vikram Subramanian bab81a9831 feat(test): Implement fakeAsync using the FakeAsyncTestZoneSpec from zone.js.
Update the version of zone.js to @0.6.12 that contains the new FakeAsyncTestZoneSpec.

The new fakeAsync zone handles errors better and clearPendingTimers() is no longer required to be called after handling an error and is deprecated.

The fakeAsync test zone will now throw an error if an XHR is attemtped within the test since that cannot be controlled synchronously in the test(Need to be mocked out with a service implementation that doesn't involve XHRs).

This commit also allows fakeAsync to wrap inject to make it consistent with async test zone.

BREAKING CHANGE:

inject can no longer wrap fakeAsync while fakeAsync can wrap inject. So the order in existing tests with inject and fakeAsync has to be switched as follows:

Before:
```
inject([...], fakeAsync((...) => {...}))
```

After:
```
fakeAsync(inject([...], (...) => {...}))
```

Closes #8142
2016-04-21 22:11:00 +00:00
Tobias Bosch cc86fee1d1 fix(compiler): support string tokens with `.` inside. 2016-04-21 11:17:49 -07:00
Tobias Bosch 386cc5dbb6 fix(transformers): support `query.read`
Closes #8172
2016-04-21 10:12:59 -07:00
Tobias Bosch 2f7045720a fix(core): various minor compiler fixes
Closes #8162
2016-04-21 09:13:02 -07:00
Kara Erickson e69cb40de3 fix(forms): number input should report null when blank
Closes #6932

Closes #8141
2016-04-20 20:33:18 +00:00
Kara Erickson 12837e1c17 fix(forms): improve error message when ngFormModel is missing a form
Closes #8136

Closes #8143
2016-04-20 20:10:50 +00:00
Tobias Bosch 9092ac79d4 refactor(core): support non reflective bootstrap.
This changes Angular so that it can be used without reflection (assuming a codegen for injectors).

BREAKIKNG CHANGE:
- Drops `APP_COMPONENT` provider. Instead, inject
  `ApplicationRef` and read its `componentTypes` property.
- long form bootstrap has changed into the following:
  ```
  var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
  var appInjector =
    ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, appProviders], platform.injector);
  coreLoadAndBootstrap(appInjector, MyApp);
  ```
2016-04-20 11:34:11 -07:00
Tobias Bosch 0a7d10ba55 refactor(core): separate reflective injector from Injector interface
BREAKING CHANGE:
- Injector was renamed into `ReflectiveInjector`,
  as `Injector` is only an abstract class with one method on it
- `Injector.getOptional()` was changed into `Injector.get(token, notFoundValue)`
  to make implementing injectors simpler
- `ViewContainerRef.createComponent` now takes an `Injector`
  instead of `ResolvedProviders`. If a reflective injector
  should be used, create one before calling this method.
  (e.g. via `ReflectiveInjector.resolveAndCreate(…)`.
2016-04-20 11:28:13 -07:00
Tobias Bosch efbd446d18 refactor(core): add `Query.read` and remove `DynamicComponentLoader.loadIntoLocation`.
This adds the feature for `@ViewChild`/`@ViewChildren`/`@ContentChild`/`@ContentChildren` to define what to read from the queried element.

E.g. `@ViewChild(`someVar`, read: ViewContainerRef)` will locate the element with a variable `someVar` on it and return a `ViewContainerRef` for it.

Background: With this change, Angular knows exactly at which elements there will be `ViewConainerRef`s as the user has to ask explicitly of them. This simplifies codegen and will make converting Angular templates into server side templates simpler as well.

BREAKING CHANGE:
- `DynamicComponentLoader.loadIntoLocation` has been removed. Use `@ViewChild(‘myVar’, read: ViewContainerRef)` to get hold of a `ViewContainerRef` at an element with variable `myVar`.
- `DynamicComponentLoader.loadNextToLocation` now takes a `ViewContainerRef` instead of an `ElementRef`.
- `AppViewManager` is renamed into `ViewUtils` and is a mere private utility service.
2016-04-20 11:28:00 -07:00
Tobias Bosch c06b0a2371 refactor(codegen): produce `.ngfactory.dart/ts` files instead of `.template.dart/ts` files.
This is needed as we will soon store other
things into the generated files, not
only the templates.
2016-04-20 11:27:34 -07:00
Tobias Bosch 0c600cf6e3 refactor(core): introduce ComponentFactory.
Each compile template now exposes a `<CompName>NgFactory` variable
with an instance of a `ComponentFactory`.
Calling `ComponentFactory.create` returns a `ComponentRef` that can
be used directly.

BREAKING CHANGE:
- `Compiler` is renamed to `ComponentResolver`,
  `Compiler.compileInHost` has been renamed to `ComponentResolver.resolveComponent`.
- `ComponentRef.dispose` is renamed to `ComponentRef.destroy`
- `ViewContainerRef.createHostView` is renamed to `ViewContainerRef.createComponent`
- `ComponentFixture_` has been removed, the class `ComponentFixture`
  can now be created directly as it is no more using private APIs.
2016-04-20 11:27:26 -07:00
Pawel Kozlowski f4e6994634 feat(NgTemplateOutlet): add NgTemplateOutlet directive
This commits adds a new NgTemplateOutlet directive that can be
used to create embeded views from a supplied TemplateRef.

Closes #7615

Closes #8021
2016-04-20 04:28:59 +00:00
Nathan Walker b602bd8c83 refactor(Location): out of router and into platform/common
closes https://github.com/angular/angular/issues/4943

BREAKING CHANGE:

`Location` and other related providers have been moved out of `router` and into `platform/common`. `BrowserPlatformLocation` is not meant to be used directly however advanced configurations may use it via the following import change.

Before:

```
import {
  PlatformLocation,
  Location,
  LocationStrategy,
  HashLocationStrategy,
  PathLocationStrategy,
  APP_BASE_HREF}
from 'angular2/router';

import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
```

After:

```
import {
  PlatformLocation,
  Location,
  LocationStrategy,
  HashLocationStrategy,
  PathLocationStrategy,
  APP_BASE_HREF}
from 'angular2/platform/common';

import {BrowserPlatformLocation} from 'angular2/src/platform/browser/location/browser_platform_location';
```

Closes #7962
2016-04-20 04:28:47 +00:00
simon-ramsay 30c43521d3 fix(http) : set response.ok based on given status code
Closes #8056
2016-04-20 04:28:27 +00:00
Eric Jimenez 45f5df371d docs(markdown): add missing space between markdown ### and text, turn h1 into h3s, remove bold.
Closes #7996
2016-04-20 04:09:31 +00:00
Felix Yan 43e31c5abb docs(): fix a typo: patform -> platform
Closes #8081
2016-04-18 19:53:19 -07:00
Andrei Alecu 0fc9ec248e fix(upgrade): clean up scope when element is destroyed
Closes #8102
2016-04-19 01:06:14 +00:00
Brandon Roberts d094a85647 fix(angular_1_router): Removed arrow function from module template
Closes #8076
2016-04-19 00:44:17 +00:00
Julie Ralph 8490921fb3 feat(tests): manage asynchronous tests using zones
Instead of using injectAsync and returning a promise, use the `async` function
to wrap tests. This will run the test inside a zone which does not complete
the test until all asynchronous tasks have been completed.

`async` may be used with the `inject` function, or separately.

BREAKING CHANGE:

`injectAsync` is now deprecated. Instead, use the `async` function
to wrap any asynchronous tests.

Before:
```
it('should wait for returned promises', injectAsync([FancyService], (service) => {
  return service.getAsyncValue().then((value) => { expect(value).toEqual('async value'); });
}));

it('should wait for returned promises', injectAsync([], () => {
  return somePromise.then(() => { expect(true).toEqual(true); });
}));
```

After:
```
it('should wait for returned promises', async(inject([FancyService], (service) => {
  service.getAsyncValue().then((value) => { expect(value).toEqual('async value'); });
})));

// Note that if there is no injection, we no longer need `inject` OR `injectAsync`.
it('should wait for returned promises', async(() => {
  somePromise.then() => { expect(true).toEqual(true); });
}));
```

Closes #7735
2016-04-18 15:59:07 -07:00
kutyel ecb9bb96f0 docs(): fix broken links
Closes #8028
2016-04-18 20:12:37 +00:00
Rob Wormald 75463cd8df chore(perf): return perf metrics from AngularProfiler
Closes #8075
2016-04-18 19:48:52 +00:00
vsavkin c6244d1470 feat(i18n): add support for nested expansion forms
Closes #7977
2016-04-18 19:38:12 +00:00
vsavkin 22ae2d0976 cleanup(html_parser): cleanup to fix analyzer warnings 2016-04-18 19:38:12 +00:00
vsavkin 88b0a239c4 feat(i18n): support plural and gender special forms 2016-04-18 19:38:12 +00:00
vsavkin 7c9717bba8 feat(html_parser): support special forms used by i18n { exp, plural, =0 {} } 2016-04-18 19:38:11 +00:00
vsavkin 7f297666ca feat(html_lexer): support special forms used by i18n { exp, plural, =0 {} } 2016-04-18 19:38:11 +00:00
Kara Erickson d99823e2fd docs(core): fix some grammar
Closes #8055
2016-04-18 19:34:17 +00:00
Kara Erickson bb9fb21fac feat(i18n): add custom placeholder names
Closes #7799

Closes #8057
2016-04-18 19:14:15 +00:00
Robert Messerle b64672b23c fix(dart) reverts `protobuf` to last working version
Closes #8125
2016-04-18 18:28:43 +00:00
Robert Messerle 930f58718b Revert "feat(i18n): add support for custom placeholder names"
This reverts commit 2abb414cfb.
2016-04-14 15:36:40 -07:00
Tobias Bosch 2b34c88b69 refactor(view_compiler): codegen DI and Queries
BREAKING CHANGE:
- Renderer:
  * renderComponent method is removed form `Renderer`, only present on `RootRenderer`
  * Renderer.setDebugInfo is removed. Renderer.createElement / createText / createTemplateAnchor
    now take the DebugInfo directly.
- Query semantics:
  * Queries don't work with dynamically loaded components.
  * e.g. for router-outlet: loaded components can't be queries via @ViewQuery,
    but router-outlet emits an event `activate` now that emits the activated component
- Exception classes and the context inside changed (renamed fields)
- DebugElement.attributes is an Object and not a Map in JS any more
- ChangeDetectorGenConfig was renamed into CompilerConfig
- AppViewManager.createEmbeddedViewInContainer / AppViewManager.createHostViewInContainer
  are removed, use the methods in ViewContainerRef instead
- Change detection order changed:
  * 1. dirty check component inputs
  * 2. dirty check content children
  * 3. update render nodes

Closes #6301
Closes #6567
2016-04-13 14:43:48 -07:00
Pascal Precht 7bc9b19418 cleanup(tests): remove unused imports
Closes #6784
2016-04-13 13:24:04 -07:00
laco0416 e9f7a00910 docs(metadata): Add more docs of ViewChild and ViewChildren
Closes #7174
2016-04-13 13:24:04 -07:00
Jason Teplitz a5d6b6db8b fix(WebWorker): Fix textarea value not being sent to the worker
Closes #7439
Closes #7828
2016-04-13 13:24:04 -07:00
Chuck Jazdzewski fc496813e2 fix(7877): StaticReflector returns empty results instead of undefined.
Reflector always returns either an empty object or an empty list if no
metadata is recorded for the class. StaticReflector matches this
behavior.

Closes #7986
2016-04-13 13:23:54 -07:00
Kara Erickson 2abb414cfb feat(i18n): add support for custom placeholder names
Closes #7799
Closes #8010
2016-04-13 13:23:42 -07:00
Igor Minar 0e56aaf189 fix: remove typescript references to d.ts files from benchpress and e2e tests
using "/// <reference" is incorrect because it makes our code non-portable. The correct solution is to provide
these typings as ambient typings as an additional entry point - which we already do.

Closes #8050
2016-04-13 13:23:27 -07:00
Alex Eagle 347e71af7d chore(travis): enable the typescript@next build
Fixes #7050
2016-04-13 18:54:58 +00:00
Tobias Bosch d24df799d3 Revert "feat(iterable_differ): support immutable lists"
In Dart, ImmutableLists are just a projection of an underlying list.
I.e. if the underlying list changes, the ImmutableList also changes.
So we can't make optimizations based on checking whether a collection
is an ImmutableList.

This reverts commit a10c02cb41.

Closes #8023
2016-04-13 17:02:48 +00:00
Alex Rickabaugh 60727c4d2b revert(format): Revert "chore(format): update to latest formatter"
This reverts commit 03627aa84d.
2016-04-12 09:41:01 -07:00
Alex Eagle 03627aa84d chore(format): update to latest formatter
Closes #7958
2016-04-11 22:15:23 +00:00
Cuel c6f454f51d docs: remove duplicate 'directives' from example
Closes #7963
2016-04-11 21:29:21 +00:00
Gion Kunz ccff17599a feat(ngFor): Support convenience view local in ngFor
Closes #8013
2016-04-11 21:27:48 +00:00
Brian Ford fb2773b8f3 docs(router): fix wording of hashchange explanation
Closes #7776
2016-04-11 21:11:11 +00:00
Tim Ruffles 5110121f6e docs(ViewQuery): fix typo in documentation
fix typo that confusingly refers to `@Query` rather than `@ViewQuery`.

Closes #7870
2016-04-11 21:04:08 +00:00
vsavkin 3b60503d2b feat(transformers): changes transformers to collect information about providers and resolve identifiers during linking 2016-04-10 19:36:16 -07:00
Federico Caselli 3c2473bac6 Fixed typo in documentation
Closes #7943
2016-04-08 23:27:36 +00:00
Chuck Jazdzewski f9426709ef chore(build): Fix errors reported using 1.9.
Closes #7954
2016-04-08 21:53:50 +00:00
Kara Erickson e1e44a910e fix(select): set value individually from ngModel
Closes #7975

Closes #7978
2016-04-08 21:08:05 +00:00
Vikram Subramanian a596b887ff feat(compiler): Add an implementation for XHR that uses a template cache to load template files.
Useful for avoiding doing an actual XHR during testing.
Part of the solution for #4051 (Other part is a Karma plugin that will create the template cache).

Closes #7940
2016-04-08 19:05:05 +00:00
Kara Erickson 6cbf99086e feat(gestures): allow override of Hammer default configuration
Closes #7924
2016-04-08 18:53:58 +00:00
Tim Blasi 26a3390549 refactor(dart/transform): Remove deprecated angular2/bootstrap
BREAKING CHANGE

Remove the deprecated angular2/bootstrap.ts &
angular2/bootstrap_static.ts libraries.

Browser entry points should import angular2/platform/browser which
supplies the `bootstrap` function.

Closes #7650
2016-04-08 18:28:35 +00:00
Alex Eagle 9a1959f77a build(tslint): re-enable linter and fix violations
fixes #7798

Closes #7800
2016-04-07 23:11:02 +00:00
Chuck Jazdzewski 226e662cf1 feat(parser): TemplateParser.tryParse() returns both the AST and errors
The language service (#7482) always needs the AST even if there are errors
in the template.

Closes #7858
2016-04-07 22:00:46 +00:00
Vijay Menon 529988bc81 Fix DDC errors 2016-04-07 21:58:48 +00:00
Kathy Walrath 09a95a692e docs(cheatsheet/dart): fix imports
Closes #7872
2016-04-07 21:23:14 +00:00
Kevin Merckx 247964af62 fix(upgrade): make upgradeAdapter upgrade angular 1 components correctly
With this fix, the $onInit function of an upgraded angular 1 component is called and input bindings (<) are created.

Closes #7951
2016-04-07 20:19:46 +00:00
Victor Berchet 5e2bc5c593 fix(RouterLink): ignore optional parameters when checking for active routes
fixes #6459
Closes #7834
2016-04-07 19:41:14 +00:00
Kara Erickson 3ca6df87b8 fix(select): update name from ng-value to ngValue
Closes #7939
2016-04-06 22:47:21 +00:00
Alexander Bachmann 4902244cce fix(router): allow forward slashes in query parameters
Closes #7824
2016-04-06 22:01:12 +00:00
vsavkin 8db97b0b7a fix(forms): support both value and ng-value 2016-04-06 14:37:57 -07:00
Andrei Alecu 9be04f8d38 fix(upgrade): leak when angular1 destroys element
Fixes #6401

Closes #7935
2016-04-06 19:58:10 +00:00
Kara Erickson 74e2bd7e3e fix(select): support objects as select values
Closes #4843

Closes #7842
2016-04-06 17:05:38 +00:00
vsavkin 52d3980d02 Revert "feat(transformers): changes transformers to collect information about providers and resolve identifiers during linking"
This reverts commit 4e9809bcb2.
2016-04-06 09:26:03 -07:00
vsavkin 4e9809bcb2 feat(transformers): changes transformers to collect information about providers and resolve identifiers during linking
Closes #7380
2016-04-04 22:59:43 +00:00
vsavkin bd8a4215dd refactor(core): remove @Injectable as only classes that are instantiated via DI need it 2016-04-04 22:59:43 +00:00
vsavkin d23b973e7a refactor(forms): extract Validators.required into a variable as transformers cannot resolve statics 2016-04-04 22:59:43 +00:00
Chuck Jazdzewski 0dbf959548 feat(static-reflector): Added StaticReflector
Added a static reflector that uses metadta produced during build
or, additionally, directly from typescript, to produce the metadata
used by Angular code generation compiler.
2016-04-01 14:45:43 -07:00
Alex Eagle 90c87fa6ad fix(codegen): stringify using an opaque ID when toString contains parens.
Using toString results in 'function (_arg1, arg2) {' when using closure compiler for 6-to-5.

Closes #7825
2016-03-30 23:43:35 +00:00
Tim Blasi c9c52fb353 build(pubspec): Clean up pubspec files
Add a direct dependency on package:path.
Remove dependency on package:quiver
2016-03-29 14:30:00 -07:00
Victor Berchet 0bcfcde63d fix(Router): handling of special chars in dynamic segments
Closes #7804
2016-03-29 20:24:28 +00:00
Tim Blasi 1c20a62611 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-29 10:55:06 -07:00
vsavkin d2ca7d81c8 feat(i18n): reexport I18nHtmlParser through the i18n barrel 2016-03-28 19:54:13 +00:00
vsavkin 756121acc1 feat(i18n): update I18nHtmlParser to accept parsed messages 2016-03-28 19:54:13 +00:00
vsavkin d7e1175df0 feat(i18n): implement xmb deserialization 2016-03-28 19:54:12 +00:00
vsavkin 66cd84e0d5 refactor(i18n): rename serialize into serializeXmb 2016-03-28 19:54:12 +00:00
Chuck Jazdzewski 506f4ce1e5 feat(compiler): Resolvers now use DI to create reflector
Also introduced ReflectorReader when only read-only access to the reflector
is needed.

Closes #7762
2016-03-28 13:52:32 -05:00
Victor Berchet a0387d2835 doc(Router): improve the example for routerOnActivate 2016-03-28 10:25:03 -07:00
vsavkin 9bdd5951d9 docs(forms): update the docs to reflect the current behavior
Closes #6504
2016-03-28 10:22:24 -07:00
Sammy Jelin 430f367c2f fix(upgrade): make ngUpgrade work with testability API
Closes #7603
2016-03-25 17:27:45 +00:00
vsavkin d272f96e23 feat(i18n): implement an i18n-aware html parser
Closes #7738
2016-03-24 20:36:19 +00:00
vsavkin 73a84a7098 refactor(i18n): remove utility functions into a separate file 2016-03-24 20:36:19 +00:00
vsavkin 17c8ec8a5d feat(html_parser): change HtmlElementAst to store both the start and the end positions 2016-03-24 20:36:19 +00:00
vsavkin a1880c3576 feat(facade): add ListWrapper.flatten 2016-03-24 20:36:19 +00:00
vsavkin 91999e016e feat(facade): add RegExpWrapper.replaceAll to replace all matches using the provided function 2016-03-24 20:36:19 +00:00
Victor Berchet aa966f5de2 feat(Compiler): Allow overriding the projection selector
fixes #6303

BREAKING CHANGE:

For static content projection, elements with *-directives are now matched against the element itself vs the template before.

    <p *ngIf="condition" foo></p>

Before:

    // Use the implicit template for projection
    <ng-content select="template"></ng-content>

After:

    // Use the actual element for projection
    <ng-content select="p[foo]"></ng-content>
Closes #7742
2016-03-24 20:09:34 +00:00
Jason Kurian 3e593b8221 chore(test.typings): instrument against examples folder
chore(typing_spec): delete unused typing_spec files

Closes #7743
2016-03-24 19:25:07 +00:00
Jason Kurian 440aca86a3 chore(examples): fix implied imports in examples for testing built typings 2016-03-24 19:25:07 +00:00
Brian Ford 6de68e2f1f feat(compiler): assert that Component.style is an array
Part of #7481 (effort to improve error messages)

Closes #7559
2016-03-24 15:21:16 +00:00
Brian Ford 49527ab495 fix(ngFor): give more instructive error when binding to non-iterable
Before, you'd get an error like:

```
EXCEPTION: Cannot find a differ supporting object ‘[object Object]’ in [users in UsersCmp@2:14]
```

Now, you get:

```
EXCEPTION: Cannot find a differ supporting object ‘[object Object]’ of type 'Object'. Did you mean to bind ngFor to an Array? in [users in UsersCmp@2:14]
```
2016-03-24 15:21:16 +00:00
PatrickJS cad693de0f refactor(NgZoneImpl): ensure zone spec is available
trace could be true (in dev mode) while there is no long stack trace spec
Closes #7702
2016-03-22 18:46:12 +00:00
Peter Bacon Darwin fb6d791ce9 test(angular1_router): check that link generation works with baseHref
Closes #7489
2016-03-22 02:19:09 +00:00
Peter Bacon Darwin 0f8efce799 fix(angular1_router): support link generation with custom hashPrefixes 2016-03-22 02:19:09 +00:00
David Reher 69c1405196 fix(angular_1_router): ng-link is generating wrong hrefs
At the moment ng-link is generating html5mode URLs for `href`s.
Instead it should check whether or not html5mode is enabled and create
the `href`s accordingly. The renaming in the `getLink` function is
aligning it to `RouterLink`'s `_updateLink`.

Closes #7423
2016-03-22 02:19:09 +00:00
Peter Bacon Darwin 980491b08f chore(angular1_router): tighten up the build regex replacement 2016-03-22 02:19:09 +00:00
Igor Minar 363ed5140e docs(bundles/overview.md): fix typo
Closes #7677
2016-03-22 01:53:35 +00:00
Igor Minar 8b67b07580 fix(package.json): remove es6-promise from the peerDependency list
As of zone.js@0.6* we no longer require an es6-promise polyfill. The polyfill is only needed on browsers that don't
have native Promise support.
2016-03-22 01:53:35 +00:00
Brian Ford 06eaaf0ac5 chore(angular1_router): bump version to v0.2.0 2016-03-22 00:20:08 +00:00
Tim Blasi b6507e37ef feat(dart/transform): Use angular2/platform/browser as bootstrap lib
Update the Angular 2 transformer to recognize
`package:angular2/platform/browser.dart` as the library which exports
the `bootstrap` function.

Update playground, examples, benchmarks, & tests to import bootstrap from
platform/browser.

Closes #7647
2016-03-21 00:58:17 +00:00
Rob Wormald 967ae3e1b8 fix(common): remove @internal annotation on SwitchView
Closes #7657
2016-03-18 13:16:50 -07:00
Misko Hevery d4e9b55fb6 fix: make sure that Zone does not show up in angular2.d.ts
Closes #7655
2016-03-18 19:41:30 +00:00
Misko Hevery 048bd280dd chore: re-enable all tests (accidental ddescribe checkin) 2016-03-18 19:41:30 +00:00
vsavkin 8326ab3240 feat(i18n): add a simple dart script extracting all i18n messages from a package
Closes #7620
2016-03-17 16:45:16 -07:00
vsavkin a7fe983be2 feat(i18n): create i18n barrel 2016-03-17 16:45:15 -07:00
vsavkin e1f8e54e34 feat(i18n): implement xmb serializer 2016-03-17 16:45:15 -07:00
vsavkin 2b165944ea refactor(i18n): move message and id into a separate file 2016-03-17 16:45:15 -07:00
Misko Hevery 2f581ffc88 fix(router): RouterOutlet loads component twice in a race condition
Closes #7497

Closes #7545
2016-03-16 22:34:54 +00:00
Jeremy Elbourn d61aaac400 chore(): remove all angular2_material code. 2016-03-16 13:37:37 -07:00
Misko Hevery 310620fd12 chore: upgrade to new Zone.js API v0.6.2
BREAKING CHANGE

Removed deprecated API from NgZone
- `NgZone.overrideOnTurnStart`
- `NgZone.overrideOnTurnDone`
- `NgZone.overrideOnEventDone`
- `NgZone.overrideOnErrorHandler`

Rename NgZone API
- `NgZone.onTurnStart` => `NgZone.onUnstable`
- `NgZone.onTurnDone` => `NgZone.onMicrotaskEmpty`
- `NgZone.onEventDone` => `NgZone.onStable`

Closes #7345
2016-03-16 18:05:09 +00:00
Brian Ford f9fb72fb0e chore(core): remove @View annotation
Closes #7495
2016-03-14 23:26:20 +00:00
vsavkin 095db673c5 feat(i18n): implement a simple version of message extractor
Closes #7454
2016-03-14 21:50:00 +00:00
vsavkin 70d18b5b53 feat(compiler): change html parser to preserve comments 2016-03-14 21:50:00 +00:00
vsavkin f1796d67f4 feat(facade): add .values to StringMapWrapper 2016-03-14 21:50:00 +00:00
Tobias Bosch cb38d72ff4 feat(shadow_css): support `/deep/` and `>>>`
Fixes #7562

Closes #7563
2016-03-11 22:14:26 +00:00
Matias Niemelä b72bab49aa feat(core): introduce a CSS lexer/parser 2016-03-11 13:54:01 -08:00
vsavkin 201475e8d8 cleanup(testing): clean up public api spec
Change the old public api spec to check only the exported top-level symbols. This will make sure that Dart and JS do not diverge. The new public api spec verifies the TS api.

Closes #7447
2016-03-11 19:24:29 +00:00
Shuhei Kagawa c25b9fcf97 docs(core): update <content> to <ng-content> 2016-03-11 11:19:52 -08:00
Jay Kan 8755a8e188 docs(): fix typo 2016-03-11 11:18:59 -08:00
Alex Eagle 127fbfd5a6 Revert "feat(core): introduce a CSS lexer/parser"
This reverts commit 293fa5505b.

The rebased commit broke CI: https://travis-ci.org/angular/angular/jobs/115388814
2016-03-11 11:14:58 -08:00
Matias Niemelä 293fa5505b feat(core): introduce a CSS lexer/parser 2016-03-11 10:42:29 -08:00
Kara Erickson df1f78e302 feat(i18n): add ngPlural directive 2016-03-10 09:55:21 -08:00
Tim Blasi 43bb31c6c6 refactor(dart/transform): Use targeted transformers
TL;DR: Modify pubspec.yaml files to use the recommended "targeted"
transformers. The unified "simple" angular2 transformer still works as
always, but we want to encourage use of the targeted transformers
whereever possible.

See [the wiki](https://github.com/angular/angular/wiki/Advanced-Transformer-Configuration)
for details about targeted transformers.

See #1872
2016-03-10 09:30:47 -08:00
Matias Niemelä 169869a195 test(matchers): add support for toMatchPattern in tests 2016-03-09 21:31:15 -08:00
Matias Niemelä b691da26af chore(facade): add enum index lookup support 2016-03-09 21:30:03 -08:00
Peter Bacon Darwin 8e3e45097a fix(router): handle URL that does not match a route
Closes #7349
Closes #7203
2016-03-09 20:48:52 -08:00
vsavkin 128acbb6eb fix(change_detection): fix a memory leak 2016-03-09 16:24:51 -08:00
Alex Eagle 5824866a83 fix(closure): don't throw from top-level
workaround for http://b/27151095
2016-03-09 16:22:35 -08:00
Peter Bacon Darwin 0d58b137a7 fix(router/instruction): ensure toLinkUrl includes extra params
Closes #7367
2016-03-09 16:21:43 -08:00
Peter Bacon Darwin 7f22bd62ab test(angular_1_router): apply annotations to controller constructors
Until Angular 1.5.1 is released, the `$routeConfig` and `$routerCanActivate`
annotations for components must live on the controller constructor.

In Angular 1.5.1, it will automatically copy these annotations across from
the component definition file.

Closes #7319
2016-03-09 21:50:24 +00:00
Peter Bacon Darwin 83f0e7c975 test(angular_1_router): fix router_spec tests
These tests were registering new components after the application had
been bootstrapped, which is not a valid use case for synchronous routes
in Angular 1.

In particular it was registering the "root" component, which caused the
`$rootRouter` to blow up, when it was instantiated, pointing to a root
component that did not yet exist.
2016-03-09 21:50:24 +00:00
Peter Bacon Darwin adef68b4d6 refactor(angular_1_router): remove directiveIntrospector
The directiveIntrospector was a bit of a hack to allow the router to
read the `$routeConfig` annocation and `$routerCanActivate` hook from
directives when they were registered.

It turns out that if we put these properties on the component controller's
constructor function (i.e. as static class methods) then we can simply
use the `$injector` to access it as required.

Currently, people put the properties directly on their component definition
objects. In Angular 1.5.1, we will copy these properties onto the controller
constructor to maintain a simple migration path. But going forward it may be
better to encourage people to add the properties directly to the controller
constructor.
2016-03-09 21:50:24 +00:00
Misko Hevery 14f0e9ada8 chore: fix DDC errors / warnings
Closes #7195
2016-03-08 22:17:32 +00:00
asukaleido 41e38e4330 fix hammer_gestures infinite loop 2016-03-08 01:37:40 +00:00
PatrickJS 2c7c3e3c69 feat(TAG_DEFINITIONS): include <meta> and <base>
needed to parse index.html as a component template
Closes #7455
2016-03-08 01:03:20 +00:00
Vikram Subramanian b857fd1eeb Revert "feat(transformers): collect provider information"
This reverts commit 81beb1c788.

Broke Google3.
2016-03-04 13:51:26 -08:00
Brandon Roberts 6dce4f49c2 feat(router): Added method to get current instruction
This method delegates to the root router to get the current complete instruction.
2016-03-04 02:10:58 -08:00
Tim Blasi 15e16148f4 feat(dart/transform): Create standalone transformers for phases
Create transformers that allow specifying transformer actions on
specific libraries.

* angular2/transform/codegen: Generates all necessary code.
* angular2/transform/reflection_rewriter: Replaces `bootstrap` calls in
  application entry points to remove transitive dart:mirrors import,
  resulting in smaller code size & faster execution.
* angular2/transform/deferred_rewriter: Rewrites deferred imports and
  `loadLibrary` calls to initialize Angular2 and preserve deferred
  operation.

Proper configuration of these three transformers can replace the single
angular2 transformer, resulting in significant performance gains for
builds of large angular2 apps.

Update angular2 itself to declare the codegen transformer, since it has
neither deferred imports nor application entry points.

Remove the undocumented & unused quick_transformer.
2016-03-04 09:52:44 +00:00
Brandon Roberts ae49085481 fix(angular_1_router): Renamed require statements after TypeScript files are transpiled
The require function was causing failures when bundled using Browserify and SystemJS

Closes #7049
2016-03-04 09:31:24 +00:00
Brandon Roberts 11e8aa26f6 feat(angular1_router): Add ng-link-active class to active ng-link
Closes #6882
2016-03-04 09:30:58 +00:00
vsavkin 81beb1c788 feat(transformers): collect provider information 2016-03-04 01:19:25 -08:00
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