Commit Graph

3977 Commits

Author SHA1 Message Date
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
Vikram Subramanian 7455b907d1 Revert "feat(dart): Add a dev-mode check for undeclared lifecycle interfaces"
This reverts commit a3d7629134.

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

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

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

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

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

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

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

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

BREAKING CHANGE:

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

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

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

BREAKING CHANGE:

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

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

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

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

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

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

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

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

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

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

Adding a directive for the pattern validator

Applying clang-format rules to modified files

Updating public api spec for new pattern validator

Adding pattern validator to public api guard tool

For #5411

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

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

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

BREAKING CHANGE:

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

BREAKING CHANGE:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

BREAKING CHANGE:

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

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

it now creates

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

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

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

`restrict: 'EA'`

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

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

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

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

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

Fixes #5973
Fixes #5807
Fixes #6266

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

Fixes #5242

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

Fixes #6817

BREAKING CHANGE:

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

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

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

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

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

Closes #5346

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

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

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

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

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

`ComponentFixture#debugElement` also returns a new DebugElement.

Breaking Change:

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

Before:

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

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

Before:

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

After:

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

Before:

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

After:

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

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

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

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

AFTER:

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

BREAKING CHANGE:

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

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

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

Closes #6359

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

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

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

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

BREAKING CHANGE: remove TemplateRef.elementRef setter

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

Closes #6410

Closes #6491
2016-01-15 22:53:09 +00:00
Mikael Morlund ae05ec69c4 Update overview.md
Closes #6478
2016-01-15 17:44:30 +00:00
Tobias Bosch eda4c3eb4c fix(template_compiler): Fix erroneous cycle detection
Before, the check for cycles was wrong and lead to false positives.

Fixes #6404

Closes #6474
2016-01-14 23:08:30 +00:00
Tim Blasi 4d0c2ed1f6 test(dart/transform): Update dependencies & fix Dart tests
Widen version dependencies for `package:angular`, `package:code_transformers`,
and `package:observe`.

`package:guinness` uses `package:unittest` while
the newest versions of `package:code_transformers` use `package:test`.
This causes our end-to-end Dart transformer tests (which use testing
code in `package:code_transformers`) to be skipped.

To fix this:
- Move e2e tests to run in a separate file
- Run `gulp test.server.dart` tests serially

Closes #5922

Closes #5935
2016-01-14 00:29:03 +00:00
Jason Teplitz eda6a5d52a refactor(WebWorker): Rename WORKER_RENDER_APP to WORKER_RENDER_APPLICATION
BREAKING CHANGE

WORKER_RENDER_APP is now deprecated. Use WORKER_RENDER_APPLICATION instead
WORKER_RENDER_APP_COMMON has been replaced by WORKER_RENDER_APPLICATION_COMMON

closes #6184

Closes #6378
2016-01-14 00:07:13 +00:00
Tim Blasi c1c54ed0f2 refactor(dart/transform): Avoid using package:code_transformers
Replace uses of `package:code_transformers`, which is only used to
convert from uri to `AssetId`, with calls to the utility methods in
`src/transform/common/url_resolver.dart`.

Closes #5931
2016-01-13 22:24:42 +00:00
Yegor Jbanov ac85cbb28a fix(web_workers): support @AngularEntrypoint in web workers
And enable transformers on all playground apps

Closes #6013
2016-01-13 17:55:01 +00:00
Julie Ralph b0cebdba6b feat(test): allow tests to specify the platform and application providers used
With providers split into bundles, the test injector is now able to
use providers for a given bundle. Suggested provider lists for tests are
available in `angular2/platform/testing/<platform>`.

Change the providers for a test suite using `setBaseTestProviders`. This
should be done once at the start of the test suite, before any test cases
run.

BREAKING CHANGE: Tests are now required to use `setBaseTestProviders`
to set up. Assuming your tests are run on a browser, setup would change
as follows.

Before:

```js
// Somewhere in test setup
import {BrowserDomAdapter} from 'angular2/src/platform/browser/browser_adapter';
BrowserDomAdapter.makeCurrent
```

After:

```js
// Somewhere in the test setup
import {setBaseTestProviders} from 'angular2/testing';
import {
  TEST_BROWSER_PLATFORM_PROVIDERS,
  TEST_BROWSER_APPLICATION_PROVIDERS
} from 'angular2/platform/testing/browser';

setBaseTestProviders(TEST_BROWSER_PLATFORM_PROVIDERS,
                     TEST_BROWSER_APPLICATION_PROVIDERS);
```

Closes #5351, Closes #5585

Closes #5975
2016-01-13 02:11:06 +00:00
Victor Berchet 933a9112da fix(ChangeDetection): chain expressions evaluate to the last expression (codegen)
fixes #4782
Closes #5892
2016-01-12 17:10:42 +00:00
eric 8c37b7e8f2 fix(directive): throw if output the same event more than once
Close: #4798
2016-01-11 16:48:57 -08:00
Brendan Wyse c8e909f8c9 docs(cheatsheet): fix pipe name in an example
Closes #6399
2016-01-12 00:12:00 +00:00
Hank Duan 69ae3634c7 feat(testability): Expose function frameworkStabilizers
Closes #5485
2016-01-11 23:10:51 +00:00
Filipe Silva b3c7df1783 docs(cheatsheet): fix bootstrap ts namespace
Fix https://github.com/angular/angular.io/issues/615
Closes #6159
2016-01-09 01:01:17 +00:00
Tobias Bosch 7ae23adaff feat(core): speed up view creation via code gen for view factories.
BREAKING CHANGE:
- Platform pipes can only contain types and arrays of types,
  but no bindings any more.
- When using transformers, platform pipes need to be specified explicitly
  in the pubspec.yaml via the new config option
  `platform_pipes`.
- `Compiler.compileInHost` now returns a `HostViewFactoryRef`
- Component view is not yet created when component constructor is called.
  -> use `onInit` lifecycle callback to access the view of a component
- `ViewRef#setLocal` has been moved to new type `EmbeddedViewRef`
- `internalView` is gone, use `EmbeddedViewRef.rootNodes` to access
  the root nodes of an embedded view
- `renderer.setElementProperty`, `..setElementStyle`, `..setElementAttribute` now
  take a native element instead of an ElementRef
- `Renderer` interface now operates on plain native nodes,
  instead of `RenderElementRef`s or `RenderViewRef`s

Closes #5993
2016-01-05 08:56:46 -08:00
vsavkin b44d36cf95 fix(forms): fix SelectControlValueAccessor not to call onChange twice
Closes #5969
2016-01-04 20:33:13 +00:00
Brian Ford a038bb9ae3 fix(router): preserve specificity for redirects
Previously when comparing which of multiple possible routes to choose in
an ambiguous case, we looked at the specificity of the target of redirect
matches rather than the original match. This meant that if a redirect
used a whilecard, but redirected to a target that was a static path,
we'd cound the static path's specificity instead of the wildcard.

This change stores the specificity of the redirect on the RedirectInstruction.

Closes #5933
2016-01-04 20:06:21 +00:00
Hank Duan 9d28147acb fix(benchpress): fix flake
memory was not allocated to be high enough, resulting in partial results to be
clipped, and therefore failing the assertions

Closes #6161
2016-01-04 19:25:32 +00:00
Victor Berchet 9a70f1a1d9 fix(TemplateParser): do not match on attrs that are bindings
Closes #5914
2015-12-24 14:44:16 +00:00
Vladislav Zarakovsky cab69f689f docs(cheatsheet): fix typo in <template> syntax description
Closes #6051
2015-12-23 02:57:47 +00:00
Brian Ford b2bc50dbd1 fix(router): correctly sort route matches with children by specificity
This changes the way we calculate specificity. Instead of using a number,
we use a string, so that combining specificity across parent-child instructions
becomes a matter of concatenating them

Fixes #5848

Closes #6011
2015-12-21 10:38:13 +00:00
Julie Ralph e748adda2e refactor(testing): move common testing logic into test_injector
Before, all test framework wrappers (internal for dart and js/ts,
angular2_test for dart and testing for js/ts) had similar logic to
keep track of current global test injector and test provider list.
This change wraps that logic into one class managed by the test
injector.

Closes #5920
2015-12-18 08:23:29 +00:00
Yegor Jbanov 630d93150a fix(core): IE only supports parentNode
Closes #5994
2015-12-18 01:48:09 +00:00
Yegor Jbanov c47d85b038 fix(code size): revert previous devMode change to restore size targets
This commit reverts a8d9dbf that introduced a code size regression (16kb gzipped, 63kb minified) in Dart.

Effect on the hello world app:

gzipped: 105kb -> 89kb
minified: 370kb -> 317kb

BREAKING CHANGE:
- This is very unlikely to be breaking, but I'm still marking just in case. The only change to the user should be that dev mode is driven by Dart's checked mode, like it was in the past.
2015-12-18 01:06:25 +00:00
vsavkin 197cf09689 feat(core): improve NoAnnotationError message
Closes #4866

Closes #5927
2015-12-17 23:37:54 +00:00
vsavkin e67ebb7f70 feat(core): improve stringify for dart to handle closures 2015-12-17 23:37:54 +00:00
flyyang 9276dad42c docs: fix some typos in comments and strings
Couple of typos fixed:
- occuring -> occurring
- imlement -> implement
- idenitifer -> identifer
etc...

Closes #5943
2015-12-17 22:57:43 +00:00
Brian Ford 2a2f9a9a19 feat(router): support links with just auxiliary routes
Closes #5930
2015-12-16 19:50:19 +00:00
Igor Minar fc75220d63 fix(router): export ROUTER_LINK_DSL_PROVIDER and hide MockPopStateEvent 2015-12-15 09:45:00 -08:00
vsavkin 3dca9d522a feat(core): enable dev mode by default
BREAKING CHANGE

Before

Previously Angular would run in dev prod mode by default, and you could enable the dev mode by calling enableDevMode.

After

Now, Angular runs in the dev mode by default, and you can enable the prod mode by calling enableProdMode.
2015-12-15 08:34:44 -08:00
Pawel Kozlowski 61b9468596 fix(bundles): rename UMD bundles
BREAKING CHANGE:

UMD bundles were renamed:
* `angular2.umd.js` -> `angular2-all.umd.js`
* `angular2-testing.umd.js` -> `angular2-all-testing.umd.js`

Closes #5898
2015-12-15 10:24:32 +00:00
Igor Minar c6f52e3282 docs(cheatsheet): fix the ES5 snippets for services 2015-12-15 01:27:19 -08:00
Igor Minar 29600c0c87 docs(bundles): update RxJS info in bundles/overview.md post-#5893 2015-12-15 01:07:16 -08:00
Igor Minar 5b63b6764f fix(docs,benchmarks): remove invalid </input> closing tags
Closing #5752
2015-12-15 00:45:31 -08:00
Jeremy Wilken 2835265916 docs(cheatsheet) adding JS specific syntax to cheatsheet
Closes #5861
2015-12-14 23:19:12 -08:00
Julie Ralph b803ecf7e7 refactor(testing): reenable injectAsync checking for return value
Before #5375, injectAsync would check the return value and fail
if it was not a promise, to help users remember that they need to
return a promise from an async test. #5375 removed that with the
introduction of the testing zone.

This un-deprecates `injectAsync` until we can resolve
https://github.com/angular/angular/issues/5515.

To be clear, this means that `inject` and `injectAsync` are now
identical except that `injectAsync` will fail if the test
does not return a promise, and `inject` will fail if the test
returns any value.

Closes #5721
2015-12-15 05:51:54 +00:00
Ciro Nunes e891baeea4 chore: remove unused decorator
Closes #5880
2015-12-15 05:20:35 +00:00
Alex Eagle 2aaef81b1b Revert "refactor(testing): move common testing logic into test_injector"
This reverts commit b88a6d983f.
2015-12-14 20:27:31 -08:00
Alex Rickabaugh 3191fd1440 cleanup(linker): Remove vestigial ComponentUrlMapper.
Closes #5849
2015-12-15 03:04:49 +00:00
Alex Rickabaugh 80a5e47e61 docs(*): Document a lot more symbols that are missing comments in our generated docs. 2015-12-15 03:04:48 +00:00
Victor Berchet 5a04ffec3e refactor(Directive): drop moduleId
moduleId is only used by components to resolve urls.
Directives have no templates and do not need moduleId.
Closes #5873
2015-12-15 01:20:56 +00:00
Pawel Kozlowski 1c779d8b9e docs(bundles): document existing bundles and their usage
Closes #5777

Closes #5878
2015-12-15 01:18:44 +00:00
Julie Ralph b88a6d983f refactor(testing): move common testing logic into test_injector
Before, all test framework wrappers (internal for dart and js/ts,
angular2_test for dart and testing for js/ts) had similar logic to
keep track of current global test injector and test provider list.
This change wraps that logic into one class managed by the test
injector.

Closes #5819
2015-12-15 01:14:48 +00:00
Jason Teplitz 006a96dd20 refactor(WebWorker): Make WebWorker bootstrap synchronous
BREAKING CHANGE

From the app thread, in both TypeScript and Dart, you bootstrap the app
using `application` instead of `asyncApplication`.
Before:
```TypeScript
platform([WORKER_APP_PLATFORM])
.asyncApplication(setupWebWorker, optionalProviders?)
.then((ref) => ref.bootstrap(RootComponent));
```
Now:
```TypeScript
platform([WORKER_APP_PLATFORM])
.application([WORKER_APP_APPLICATION])
.bootstrap(RootComponent);
```

closes #5857

Closes #5862
2015-12-14 21:04:46 +00:00
Georgios Kalpakas 1607ef8782 refactor(HtmlLexer): process carriage returns in one pass
Closes #5867
2015-12-14 20:17:06 +00:00
vsavkin 43f42d9c6e feat(facade): do not reexport Observable from angular2/core
BREAKING CHANGE

Before import {Observable} from 'angular2/core'

After import {Observable} from 'rxjs/Observable';
2015-12-12 19:28:13 +00:00
Jeff Cross a885f37dfa fix(web_workers): remove unnecessary setup module and AppRootUrl
Since AppRootUrl is removed, the logic for extending and emitting
the root url as part of the setup seems unnecessary.

BREAKING CHANGES:

The setupWebWorker function exported from 
angular2/platform/worker_app  no longer returns a promise of providers, 
but instead synchronously returns providers.

Related to #5815
Closes #5820
2015-12-12 00:58:56 +00:00
Jeff Cross ed2c25eb2f fix(compiler): remove AppRootUrl
Related to #5815

This should not break anything because AppRootUrl wasn't actually
being used by the compiler anymore.
2015-12-12 00:58:56 +00:00
Tobias Bosch b1b0593ddf docs(core): replace `angular2/angular2` with the right barrel import.
Related to #5710
Closes #5847
2015-12-11 15:30:25 -08:00
Tobias Bosch 200dc00dbb fix(angular2): remove `angular2.ts` module
Closes #5815
Closes #5844

BREAKING CHANGE:

`angular2/angular2` was removed. Use the correct import from one of the barrels. E.g. `angular2/core`, `angular2/platform/browser`,  `angular2/common`, …

Note: This only applies to JavaScript, Dart is not changed.
2015-12-11 14:21:33 -08:00
Pawel Kozlowski 20c6eebb29 fix(angular2): don't export compiler bits as public API
Closes #5815
Closes #5797

BREAKING CHANGE:

The following symbols are not exported from angular2/angular2 any more:
`UrlResolver`, `AppRootUrl`, `getUrlScheme`, `DEFAULT_PACKAGE_URL_PROVIDER`.
Use imports from `angular2/compiler` instead.
2015-12-11 14:04:01 -08:00
vsavkin 44c648fc04 Revert "fix(animate): ensure transition properties are removed once the animation is over"
This reverts commit b8e69a21a9.
2015-12-11 13:13:11 -08:00
Jeff Cross 979162d324 fix(public_spec): check exports of barrels instead of angular2/angular2
This changes the public api spec to check each public barrel individually
to make sure its API has not changed. The previous API spec has been
preserved but split into respective barrels.

The compiler barrel has been added to the spec, along with all of its
public exports. Previously, angular2/angular2 was only exporting a
handful of symbols from compiler, so there are now many more symbols
being tested in the spec for compiler than previously.

Part of #5710
Closes #5841
Supercedes #5821
2015-12-11 13:05:52 -08:00
Yegor Jbanov 2934b82113 chore(tools): remove unused performance import
Closes #5840
2015-12-11 20:32:17 +00:00
Tim Blasi 92ddc62bed fix(styles): Escape \r characters in compiled text
Closes #5772

Closes #5835
2015-12-11 19:48:43 +00:00
gdi2290 0cb32c2fef feat(Headers): implement `toJSON` 2015-12-11 19:40:56 +00:00
Alejandro Caravaca Puchades 2ca5e38a78 fix(upgrade): allow directives with empty template 2015-12-11 11:39:45 -08:00
Matias Niemelä b8e69a21a9 fix(animate): ensure transition properties are removed once the animation is over 2015-12-11 11:38:24 -08:00
Kathy Walrath 3fd898e91f docs(cheatsheet): copyedit
Fixed a few little things. I'll probably have more changes to make later, once I understand everything better.

Also added a missing syntax line.

Closes #5806
2015-12-11 18:41:57 +00:00
Pawel Kozlowski a66cc50168 refactor(testing): limit imports of barrel-private APIs
Closes #5603
2015-12-11 18:39:56 +00:00
Pawel Kozlowski eb296756fb refactor(benchmarks): remove imports from 'angular2/angular2'
Closes #5799
2015-12-11 18:33:03 +00:00
Pawel Kozlowski f1a9a537cb test(core): remove imports from 'angular2/angular2'
Closes #5829
2015-12-11 18:02:23 +00:00
Victor Berchet 080469f8e6 fix(HtmlParser): allow ng-content elements regardless the namespace
relates to #5547
Closes #5745
2015-12-11 01:36:48 +00:00
Victor Berchet 7c13372721 fix(TemplateParser): match element and attributes regardless the namespace 2015-12-11 01:36:48 +00:00
Alex Rickabaugh 778677ba75 docs(core): Myriad of documentation changes including lots of new example code. 2015-12-10 15:23:57 -08:00
Cody Lundquist e9e2a4152e docs: fix variable name, change to camelCase
closes #5801
2015-12-10 14:35:28 -08:00
Rob Wormald 398f024b24 fix(async): support BehaviorSubjects in async pipe 2015-12-10 21:49:40 +00:00
Rob Wormald 4a17e6906c fix(async): improve Rx support in ObservableWrapper 2015-12-10 21:49:40 +00:00
Pawel Kozlowski 8d3e5596dc refactor(playground): remove imports from 'angular2/angular2'
Part of #5710

Closes #5798
2015-12-10 21:46:51 +00:00
Pawel Kozlowski df6d2d1e23 refactor(examples): remove imports from 'angular2/angular2'
Closes #5803
2015-12-10 21:45:58 +00:00
Pawel Kozlowski d26c338aa0 refactor(material): remove imports from 'angular2/angular2'
Closes #5800
2015-12-10 21:19:38 +00:00
Tobias Bosch edcb34dc9f fix(dom_renderer): moveNodeAfterSiblings should not detach the reference node
Fixes #5077
Closes #5759
2015-12-10 20:14:27 +00:00
Jeff Cross 693d9dce5d fix(parse5): support comment nodes with getText and setText
In the browser, calling element.textContent causes child comment
nodes to be ignored, while getting textContent directly on a
comment node will return the comment. This change makes
parse5Adapter consistent with this behavior by adding a 2nd
argument to getText telling if it's being called recursively.

Closes #5805
2015-12-10 19:18:14 +00:00
Jeff Cross 194dc7da78 feat(renderer): use a comment instead of an element when stamping out template>` elements
Originally authored by @tbosch, this reverts the revert commit
e274ff8a69.

Closes #4805
2015-12-10 19:18:14 +00:00
Jeff Cross 79399e1c51 feat(dom_renderer): add setBindingDebugInfo method
This is used for setting property binding values as attributes
on elements when running in dev mode. This implementation will
also serialize binding information to template placeholder
comment nodes.

Closes #5227
2015-12-10 19:18:14 +00:00
Olivier Chafik fe1dd77d94 feat(benchpress): add receivedData + requestCount to PerflogMetric
Closes #5750
2015-12-10 18:51:47 +00:00
Igor Minar cf3ce171a5 docs(kebab-case.md): more fixes and CSS migration instructions
Closes #5773
2015-12-10 04:18:17 -08:00
Jesús Rodríguez Rodríguez 06d076a6f2 docs(kebab-case): fix typo on property
Closes #5783
2015-12-10 03:42:43 -08:00
Daniel 3190c5941a fix(changelog): fix ngFor on template
Closes #5785
2015-12-10 03:41:00 -08:00
Igor Minar 30e25acb9f fix(core): workaround for typescript@1.7.3 breakage #5784
I don't understand why I need to declare the type-here, but it resolves the issue.

Looks like a bug in tsc.

Fixes #5784
2015-12-10 03:30:16 -08:00
Igor Minar b3d10af89a docs(kebab-case.md): fix indentation, add links and other small changes 2015-12-10 00:48:32 -08:00
Igor Minar 4724cc664e docs(kebab-case.md): add link to the design doc 2015-12-10 00:18:08 -08:00
Victor Berchet 9e44dd85ad feat(camelCase Angular): legacy template transformer 2015-12-09 19:59:40 -08:00
Victor Berchet da9b46a071 feat: camelCase Angular (kebab-case removal)
BREAKING CHANGE:

Angular is now fully camel case.

Before:

    <p *ng-if="cond">
    <my-cmp [my-prop]="exp">
    <my-cmp (my-event)="action()">
    <my-cmp [(my-prop)]="prop">
    <input #my-input>
    <template ng-for #my-item [ng-for-of]=items #my-index="index">

After

    <p *ngIf="cond">
    <my-cmp [myProp]="exp">
    <my-cmp (myEvent)="action()">
    <my-cmp [(myProp)]="prop">
    <input #myInput>`,
    <template ngFor="#my-item" [ngForOf]=items #myIndex="index">

The full details are found in [angular2/docs/migration/kebab-case.md](https://github.com/angular/angular/blob/master/modules/angular2/docs/migration/kebab-case.md)
2015-12-09 19:59:40 -08:00
Victor Berchet b386d1134a doc(camelCase Angular): migration guide 2015-12-09 19:59:40 -08:00
Igor Minar 51cb7586e0 build(npm): update to typescript@1.7.3 + fix broccoli-typescript + fix src 2015-12-10 01:32:44 +00:00
Matias Niemelä 28860d35b2 feat(core): provide support for relative assets for components
Assets defined for `templateUrl` and `styleUrls` can now be loaded
in relative to where the component file is placed so long as the
`moduleId` is set within the component annotation.

Closes #5634
2015-12-09 16:28:49 -08:00
Matias Niemelä 5f0ce30ee6 revert: feat(core): provide support for relative assets for components 2015-12-09 16:26:42 -08:00
Kathy Walrath f4d937ad8d docs(cheatsheet): add Dart-specific syntax & headings
Closes #5756
2015-12-09 23:05:23 +00:00
Matias Niemelä db096a5e22 feat(core): provide support for relative assets for components
Assets defined for `templateUrl` and `styleUrls` can now be loaded
in relative to where the component file is placed so long as the
`moduleId` is set within the component annotation.

Closes #5634

Closes #5634
2015-12-09 22:04:00 +00:00
Pawel Kozlowski 793098bcce refactor(upgrade): remove imports from angular2/angular2
Related #5739
2015-12-09 21:04:41 +00:00
Jeff Cross 61e8b60506 docs(Observable): add documentation for Observable and operators
Closes #5642
Closes #5684
2015-12-09 19:32:30 +00:00
Peter Bacon Darwin 2f0744b089 docs(cheatsheet): update to new syntax
See https://github.com/angular/angular.io/pull/459

Closes #5733
2015-12-09 19:04:08 +00:00
Peter Bacon Darwin ca73852746 docs(AngularEntrypoint): add missing backticks 2015-12-09 19:04:08 +00:00
Michael Mrowetz 72444c40a7 typo fix: registerPrimaryOutlet description
Closes #5648
2015-12-08 19:55:35 -08:00
Rob Wormald cbf788869d fix(http): use `any` for res.json() return
fixes #5636

Closes #5646
2015-12-09 03:00:22 +00:00
Marc Laval c1ae49d91e fix(testing): remove Symbol dummy shim
Closes #5067

Closes #5719
2015-12-09 02:57:19 +00:00
Rob Wormald 869a392357 fix(package) add missing comma in ngHttp package.json
Closes #5727
2015-12-08 18:51:19 -08:00
Pawel Kozlowski a4ba46cb99 fix(bundles): remove SFX bundle
Closes #5665

BREAKING CHANGE:

The existing sfx bundle (angular2.sfx.dev.js) is replaced by UMD bundles:
angular2.umd.js and angular2.umd.dev.js. The new UMD bundles dont have
polyfills (zone.js, reflect-metadata) pre-appended. Those polyfills
can be easily loaded by including the angular-polyfills.js bundle.

Closes #5712
2015-12-08 16:09:52 -08:00
vsavkin 0df8bc4e52 fix(dynamic_component_loader): leave the view tree in a consistent state when hydration fails
Closes #5718
2015-12-08 16:09:38 -08:00
vsavkin 0d9a1de4d9 fix(bootstrap): fix the configuration of ExceptionHandler 2015-12-08 16:09:37 -08:00
vsavkin d58f017226 cleanup(pipes): improve the error message of InvalidPipeArgumentException 2015-12-08 16:09:37 -08:00
Brian Ford aa85856e1c fix(router): set correct redirect/default URL from hashchange
Currently, hashchange events outside of Angular that cause navigation
do not take into account cases where the initial route URL changes
due to a redirect or a default route.

Closes #5590

Closes #5683
2015-12-08 22:34:19 +00:00
Victor Berchet 8657ca4298 fix(form): Form directives are exportedAs 'ngForm' (was 'form')
fixes #5658

BREAKING CHANGE:

Before:

    <form #f="form">

After:

    <form #f="ngForm">

Closes #5709
2015-12-08 20:25:16 +00:00
Igor Minar 80b025ae53 build(broccoli): convert dependencies to peerDependencies in all package.json templates
This is more correct and resolves the issue of having dupes within the same project.

This change has no impact on our shrinkwrap since peerDeps and deps are merged into one
within the shrinkwrap file.

BREAKING CHANGE: rxjs, reflect-metadata, zone.js and es6-shims now must be specified as
explicit dependencies of each angular app that uses npm for package management.

To migrate, please add the following into the "dependencies" section of your package.json:

```
"dependencies": {
    ...

    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-alpha.11",
    "zone.js": "0.5.8"

    ...
}
```

Closes #5560

Closes #5649
2015-12-08 11:52:26 -08:00
Jeff Cross c39f4c3b38 refactor(Observable): implement toPromise and fromPromise without side effects
BREAKING CHANGE:

toPromise is no longer an instance method of the `Observable` returned
by Angular, and fromPromise is no longer available as a static method.

The easiest way to account for this change in applications is to import
the auto-patching modules from rxjs, which will automatically add these
operators back to the Observable prototype.

```
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/observable/fromPromise';
```

Closes #5542
Closes #5626
2015-12-08 18:31:02 +00:00
Victor Berchet 1f35048d54 feat(TemplateParser): allow template elements regardless the namespace
Closes #5703
2015-12-08 17:46:14 +00:00
Victor Berchet eb0ea931d0 fix(HtmlParser): ignore LF immediately following pre, textarea & listing
fixes #5630

Closes #5688
2015-12-08 02:39:17 +00:00
Victor Berchet 47f1d12731 fix(HtmlLexer): tag name must follow "<" without space
see http://www.w3.org/TR/html5/syntax.html#tag-open-state
2015-12-08 02:39:17 +00:00
Victor Berchet aecf68117a feat(HtmlLexer): allow "<" in text tokens
fixes #5550
2015-12-08 02:39:17 +00:00
Victor Berchet 3a438615c3 fix(HtmlParser): Do not add parent element for template children
fixes #5638
2015-12-08 02:39:17 +00:00
Victor Berchet 9850e68703 fix(HtmlLexer): handle CR in input stream per HTML spec
fixes #5618
Closes #5629
2015-12-08 02:18:20 +00:00
Tero Parviainen daaa8ee1cd fix(compiler): support properties on SVG elements
Have DomElementSchemaRegistry support namespaced elements,
so that it does not fail when directives are applied in SVG (or xlink).
Without this fix, directives or property bindings cannot be
used in SVG.

Related to #5547

Closes #5653
2015-12-08 02:18:07 +00:00
Pawel Kozlowski 50490b55eb fix(HtmlParser): mark <source> elements as void
Fixes #5663

Closes #5668
2015-12-08 02:15:15 +00:00
Brandon Roberts 7f0925eb2b docs(router): Updated documentation for router generate method
Closes #5399
2015-12-08 01:44:53 +00:00
Julie Ralph 85d89babce fix(build): lock down version of package:code_transformers
A new verion is causing build issues, perhaps due to an undeclared
dependency on package:test. For now, lock down the version to the
last known working one.
2015-12-07 17:42:24 -08:00
Yegor Jbanov 2d313c4d1d chore(parser): add tests for conditional expressions
Closes #5647
2015-12-07 15:16:57 -08:00
cexbrayat e6170e8ac3 docs(http): fix MockBackend imports
Fixes #5639

Closes #5651
2015-12-07 15:16:18 -08:00
Pascal Precht c6d6b75691 refactor(test/linker): fix typo in directive name 2015-12-04 19:32:51 -08:00
Pascal Precht f664a9c4d5 refactor(test/linker): remove unused directive in tests 2015-12-04 19:32:51 -08:00
Victor Berchet d388c0ae62 feat(HtmlParser): enforce only void & foreign elts can be self closed
BREAKING CHANGE:

`<whatever />` used to be expanded to `<whatever></whatever>`.
The parser now follows the HTML5 spec more closely.
Only void and foreign elements can be self closed.

Closes #5591
2015-12-04 20:05:27 +00:00
Victor Berchet 56604468e0 feat(HtmlParser): enforce no end tag for void elements
BREAKING CHANGE

End tags used to be tolerated for void elements with no content.
They are no more allowed so that we more closely follow the HTML5 spec.
2015-12-04 20:05:27 +00:00
cexbrayat b925ff5b8d refactor(http): rename enums to be singular
ReadyStates -> ReadyState
RequestMethods -> RequestMethod
ResponseTypes -> ResponseType

Fixes #5574

BREAKING CHANGE:

Before

import {ReadyStates, RequestMethods, ResponseTypes} from 'angular2/http';

After

import {ReadyState, RequestMethod, ResponseType} from 'angular2/http';

Closes #5584
2015-12-04 19:16:00 +00:00
Thomas Henley c6a5d9bc84 refactor(validators) rename maxLength validator parameter
Closes #5592
2015-12-04 18:49:02 +00:00
Jason Teplitz 5e50859a03 fix(WebWorker): Add @AngularEntrypoint to worker_app bundle
Closes #5588
2015-12-04 01:26:20 +00:00
vsavkin 4ea5b6e57f feat(router): implement router link DSL
Closes #5557

Closes #5562
2015-12-04 00:47:20 +00:00
Victor Berchet e67e1952d0 fix(HtmlParser): ng-content is not a void element
fixes #5563
Closes #5586
2015-12-03 23:42:46 +00:00
Tobias Bosch 0614797d84 refactor(test_injector): Provide separate methods for creating test injector with and without runtime compiler.
BREAKING CHANGE:
`createTestInjector()` does not more include the runtime compiler. Use `createTestInjectorWithRuntimeCompiler()` instead.
Closes #5583
2015-12-03 22:50:14 +00:00
Tim Blasi 0a3a17ff10 fix(dart/reflection): Fix `NoReflectionCapabilities` interface
Make `NoReflectionCapabilities` conform to the `PlatformReflectionCapbilities`
api, which prevents some confusing error messages.

Closes #5559

Closes #5578
2015-12-03 22:11:26 +00:00
erictsangx 680f7e0299 fix(core/forms): input[type=text] .valueChanges fires unexpectedly
Closes #4768, #5284

Closes #5401
2015-12-03 22:11:16 +00:00
Brandon Roberts 478a25ed27 refactor(angular_1_router): Added value for router root component
Closes #4965

Closes #5052
2015-12-03 22:05:51 +00:00
Jason Teplitz 1710272b3c refactor(WebWorker): Use the new generic bootstrap.
BREAKING CHANGE:

You can no longer bootstrap a WebWorker or Isolate using `bootstrap` or `bootstrapWebWorker`. Instead you have to do the following:

In TypeScript:
```TypeScript
// index.js
import {WORKER_RENDER_PLATFORM, WORKER_RENDER_APPLICATION, WORKER_SCRIPT} from "angular2/platforms/worker_render";
import {platform} from "angular2/platform";

platform([WORKER_RENDER_PLATFORM])
.application([WORKER_RENDER_APPLICATION, new Provider(WORKER_SCRIPT, {useValue: "loader.js"});
```
```JavaScript
// loader.js
importScripts("https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.3/es6-shim.js", "https://jspm.io/system@0.16.js", "angular2/web_worker/worker.js");
System.import("app");
```
```TypeScript
// app.ts
import {Component, View} from "angular2/core";
import {WORKER_APP_PLATFORM, setupWebWorker} from "angular2/platforms/worker_app";
import {platform} from "angular2/platform";

@Component({
  selector: "hello-world"
})
@View({
  template: "<h1>Hello {{name}}</h1>
})
export class HelloWorld {
  name: string = "Jane";
}

platform([WORKER_APP_PLATFORM])
.asyncApplication(setupWebWorker, optionalProviders?)
.then((ref) => ref.bootstrap(RootComponent));
```

In Dart:
```Dart
// index.dart
import "angular2/platform.dart";
import "angular2/platforms/worker_render.dart";

main() {
  platform([WORKER_RENDER_PLATFORM])
  .asyncApplication(initIsolate("my_worker.dart"));
}
```
```Dart
// background_index.dart
import "angular2/platform.dart";
import "angular2/platforms/worker_app.dart";
import "package:angular2/src/core/reflection/reflection.dart";
import "package:angular2/src/core/reflection/reflection_capabilities.dart";

@Component(
  selector: "hello-world"
)
@View(
  template: "<h1>Hello {{name}}</h1>"
)
class HelloWorld {
  String name = "Jane";
}

main(List<String> args, SendPort replyTo) {
  reflector.reflectionCapabilities = new ReflectionCapabilities();
  platform([WORKER_APP_PLATFORM])
    .asyncApplication(setupIsolate(replyTo))
      .then((ref) => ref.bootstrap(RootComponent));
}

```

You should no longer import from the `angular2/web_worker/worker` and `angular2/web_worker/ui` paths. Instead you can now import directly from core, directives, etc..

The WebWorkerApplication class has been removed. If you want to use ServiceMessageBroker or ClientMessageBroker on the render thread, you must inject their factories via DI.
If you need to use the MessageBus on the render thread you must also obtain it through DI.

closes #3277
closes #5473

Closes #5519
2015-12-03 19:51:43 +00:00
Julie Ralph 93a1ec29e1 feat(test): add angular2_testing dart library
angular2_testing is a user-facing dart test library built on top of
the package:test dart unittest framework and runner. For usage,
see modules_dart/angular2_testing/README.md.

Closes #3289
2015-12-03 11:33:46 -08:00
Victor Berchet d90a2269f9 feat(HtmlParser): add most common named character references
fixes #5546
Closes #5579
2015-12-03 19:28:50 +00:00
Foxandxss 69996b1740 test(http): remove stale SpyObserver
Closes #5134
2015-12-03 10:54:42 -08:00
Tim Blasi 35e32bbea1 feat(mocks): Mark mock objects @Injectable()
Make mock objects `@Injectable()` to allow using them in compiled tests.

Closes #5576
2015-12-03 10:49:56 -08:00
Julie Ralph e9f873a365 feat(testing): export useful properties from componentFixture
The component fixture returned from the test component builder
now exports `nativeElement` and `componentInstance` members
directly. They are also still available on the `debugElement`.

See #5385
2015-12-02 16:05:01 -08:00
Jeff Cross 25a2d7b5db chore(async): clean up unused promise imports 2015-12-02 16:02:34 -08:00
Rob Wormald c635a73ed9 refactor(http): remove mockbackend export from angular2/http barrel 2015-12-02 16:02:34 -08:00
Jeff Cross f76eea4f9b chore(http): update http example to include map operator 2015-12-02 16:02:34 -08:00
Rob Wormald 5514dc19d9 refactor(facade): use rxjs package
move to new RxJS distribution.

BREAKING CHANGE:

RxJS imports now are via `rxjs` instead of `@reactivex/rxjs`
Individual operators can be imported `import 'rxjs/operators/map'`
2015-12-02 16:02:34 -08:00
Rob Wormald a16ac84840 refactor(async): use ultralight Observable
Closes #5283
2015-12-02 16:02:34 -08:00
Julie Ralph ad99199d50 chore(test): remove deprecated RootTestComponent
Uses of `RootTestComponent` should be migrated to `ComponentFixture`.
2015-12-02 15:00:55 -08:00
Gion Kunz c7242a39d2 style(playground): use single quotes consistently 2015-12-02 14:59:55 -08:00
mlaval 4fa1809f80 chore(build): make the unit tests campaign to run again in Edge 2015-12-02 14:34:31 -08:00
mlaval fb16c39496 chore(build): fix flakiness of the element probe global test 2015-12-02 14:19:07 -08:00
Victor Berchet 62c2ed7c43 feat(HtmlParser): better error message when a void tag has content 2015-12-02 14:17:41 -08:00
Victor Berchet 9c6b929c7b fix(HtmlParser): close void elements on all node types
fixes #5528
2015-12-02 14:17:41 -08:00
Jesper Rønn-Jensen 070d818e68 refactor(tests): rename beforeEachBindings -> beforeEachProviders
Change beforeEachBindings to beforeEachProviders but preserve the
@deprecated method beforeEachBindings, in order to keep a working
deprecation warning
2015-12-02 14:09:13 -08:00
mgechev 1417e12f28 refactor(playground): rename bindings to providers 2015-12-02 13:02:53 -08:00
vsavkin 9a65ea7ea7 feat(core): remove typings from package.json to disallow 'import * as n from 'angular2'''
The typings property is being removed because angular2.ts is deprecated, and the developers should import from angular2/core and angular2/platform/*.  So aliasing angular2 to angular2/angular2 does not make sense.

BREAKING CHANGE

Before

import * as ng from 'angular2';

After

import * as core from 'angular2/core';
2015-12-02 11:48:14 -08:00
Victor Berchet c58e7e0e91 fix(HtmlParser): do not add a tbody parent for tr inside thead & tfoot
fixes #5403
2015-12-02 11:43:51 -08:00
Tim Ruffles bdfed9d850 docs(core): make naming concrete
I think people new to promises, angular etc will find this example easier to understand with concrete identifiers from a simple use-case. The existing naming could be confused with promise/angular functionality (`promise` in the template, `resolved` etc).

Also I made `resolve` private, as then it's clear what we're exposing for the template.
2015-12-02 11:41:52 -08:00
Pascal Precht b9b14dc731 docs: fix typo event1 -> event 2015-12-02 11:40:20 -08:00
Wassim Chegham cf3ceba2cc docs(api): remove extra `the` 2015-12-02 11:38:24 -08:00
Julie Ralph c08d76c7f8 chore(test): remove deprecated angular2/test and angular2/test_lib
These have been deprecated for a while. Instead of angular2/test, use
angular2/testing. Instead of angular2/test_lib, use angular2_testing_internal.
2015-12-02 11:37:29 -08:00
vsavkin 442d6866da test: add a test verifying that the tests are run in the checked mode 2015-12-02 11:29:11 -08:00
Tim Blasi 6b2ef25c69 feat(dart/transform): Introduce @AngularEntrypoint() 2015-12-01 13:34:29 -08:00
Pawel Kozlowski 3e364b0d41 test(schema): fix test names 2015-12-01 13:33:06 -08:00
Pascal Precht c4c4d045fb chore(playground/routing): remove unused bind import
Closes #5305
2015-12-01 18:23:54 +00:00
Jeff Cross fcc7ce225e refactor(pipes): use angular lifecycle hooks instead of PipeOnDestroy
BREAKING CHANGE:
Previously, pipes that wanted to be notified when they were destroyed
would implement the PipeOnDestroy interface and name the callback
`onDestroy`. This change removes the PipeOnDestroy interface and
instead uses Angular's lifecycle interface `OnDestroy`, with the
`ngOnDestroy` method.

Before:
```
import {Pipe, PipeOnDestroy} from 'angular2/angular2';
@Pipe({pure: false})
export class MyPipe implements PipeOnDestroy {
  onDestroy() {}
}
```

After:
import {Pipe, OnDestroy} from 'angular2/angular2';
@Pipe({pure: false})
export class MyPipe implements PipeOnDestroy {
  ngOnDestroy() {}
}
2015-11-30 16:40:50 -08:00
Jeff Cross 604c8bbad5 refactor(lifecycle): prefix lifecycle methods with "ng"
BREAKING CHANGE:
Previously, components that would implement lifecycle interfaces would include methods
like "onChanges" or "afterViewInit." Given that components were at risk of using such
names without realizing that Angular would call the methods at different points of
the component lifecycle. This change adds an "ng" prefix to all lifecycle hook methods,
far reducing the risk of an accidental name collision.

To fix, just rename these methods:
 * onInit
 * onDestroy
 * doCheck
 * onChanges
 * afterContentInit
 * afterContentChecked
 * afterViewInit
 * afterViewChecked
 * _Router Hooks_
 * onActivate
 * onReuse
 * onDeactivate
 * canReuse
 * canDeactivate

To:
 * ngOnInit,
 * ngOnDestroy,
 * ngDoCheck,
 * ngOnChanges,
 * ngAfterContentInit,
 * ngAfterContentChecked,
 * ngAfterViewInit,
 * ngAfterViewChecked
 * _Router Hooks_
 * routerOnActivate
 * routerOnReuse
 * routerOnDeactivate
 * routerCanReuse
 * routerCanDeactivate

The names of lifecycle interfaces and enums have not changed, though interfaces
have been updated to reflect the new method names.

Closes #5036
2015-11-30 16:40:50 -08:00
Brian Ford 4215afc639 fix(router): fix a typing issue
Closes #5518
2015-12-01 00:09:40 +00:00
vsavkin 909031e688 refactor(tests): move facades tests out of tests/core
Closes #5472
2015-11-30 22:24:35 +00:00
vsavkin b7b3c85033 refactor(core): move EventManager from core to platform/dom
Closes #5465
2015-11-30 22:24:35 +00:00
Julie Ralph 0c9596ae2b feat(testing): use zones to avoid the need for injectAsync
Use a zone counting timeouts and microtasks to determine when a test
is finished, instead of requiring the test writer to use
injectAsync and return a promise.

See #5322
2015-11-30 14:06:06 -08:00
vsavkin 87ddc8fb6a fix(compiler): dedup directives in template compiler
Closes #5311

Closes #5464
2015-11-30 19:37:54 +00:00
Brian Ford 6ddfff5cd5 refactor(router): improve recognition and generation pipeline
This is a big change. @matsko also deserves much of the credit for the implementation.

Previously, `ComponentInstruction`s held all the state for async components.
Now, we introduce several subclasses for `Instruction` to describe each type of navigation.

BREAKING CHANGE:

Redirects now use the Link DSL syntax. Before:

```
@RouteConfig([
	{ path: '/foo', redirectTo: '/bar' },
	{ path: '/bar', component: BarCmp }
])
```

After:

```
@RouteConfig([
	{ path: '/foo', redirectTo: ['Bar'] },
	{ path: '/bar', component: BarCmp, name: 'Bar' }
])
```

BREAKING CHANGE:

This also introduces `useAsDefault` in the RouteConfig, which makes cases like lazy-loading
and encapsulating large routes with sub-routes easier.

Previously, you could use `redirectTo` like this to expand a URL like `/tab` to `/tab/posts`:

@RouteConfig([
	{ path: '/tab', redirectTo: '/tab/users' }
	{ path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

Now the recommended way to handle this is case is to use `useAsDefault` like so:

```
@RouteConfig([
	{ path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

@RouteConfig([
	{ path: '/posts', component: PostsCmp, useAsDefault: true, name: 'Posts' },
	{ path: '/users', component: UsersCmp, name: 'Users' }
])
TabsCmp { ... }
```

In the above example, you can write just `['/Tab']` and the route `Users` is automatically selected as a child route.

Closes #4728
Closes #4228
Closes #4170
Closes #4490
Closes #4694
Closes #5200

Closes #5475
2015-11-30 17:06:03 +00:00
Brian Ford a3253210b7 Revert "Revert "test(router): remove View decorator in router link fixtures""
This reverts commit a3353a5e28.
2015-11-30 17:06:03 +00:00
Brian Ford 0dbd0b340c Revert "Revert "feat(router): allow linking to auxiliary routes""
This reverts commit cee67e6fe0.
2015-11-30 17:06:03 +00:00
Pawel Kozlowski 8c670822ce chore(bundles): don't distribute sfx bundles for http
Currently the main sfx bundle already contains http and router
and the http sfx bundles duplicates all core.

Additionally https://github.com/angular/angular/issues/5223
modifies our strategy for individual bundles

Closes #5434
2015-11-30 16:29:58 +00:00
Yegor Jbanov b90de66535 fix(parser): do not crash on untokenizable quote prefixes
Closes #5486
2015-11-25 23:43:52 +00:00
Brian Ford 1bec4f6c61 feat(router): add support for APP_BASE_HREF to HashLocationStrategy
Closes #4935
Closes #5368

Closes #5451
2015-11-25 22:29:43 +00:00
Yegor Jbanov b6ec2387b3 feat(templates): introduce quoted expressions to support 3rd-party expression languages
A quoted expression is:

quoted expression = prefix `:` uninterpretedExpression
prefix = identifier
uninterpretedExpression = arbitrary string

Example: "route:/some/route"

Quoted expressions are parsed into a new AST node type Quote. The `prefix` part of the
node must be a legal identifier. The `uninterpretedExpression` part of the node is an
arbitrary string that Angular does not interpret.

This feature is meant to be used together with template AST transformers introduced in
a43ed79ee7. The
transformer would interpret the quoted expression and convert it into a standard AST no
longer containing quoted expressions. Angular will continue compiling the resulting AST
normally.
2015-11-25 14:28:11 -08:00
mlaval cf157b99d3 chore(test): fix public API test in some browsers
Fixes #5470

Closes #5478
2015-11-25 21:44:26 +00:00
Yegor Jbanov d59c20c315 fix(web worker): remove usages of deprecated zone API
Closes #5425
2015-11-25 19:25:08 +00:00
Nathan Walker 019cb41dd8 fix(EventEmitter): resolve onError and onComplete asynchronously
closes #4443
2015-11-24 16:54:13 -08:00
Yegor Jbanov b4de41b74e chore(parser): cleanup unused imports
Closes #5424
2015-11-24 19:36:30 +00:00
vsavkin 87d56acdaa fix(build): fix source maps
Closes #5444
2015-11-24 19:33:27 +00:00
vsavkin 8daa9b202d cleanup(testing): create top level files for mocks
Closes #5381
2015-11-24 19:29:52 +00:00
vsavkin 89eefcd7b5 cleanup(tooling): move tooling to the browser platform and rename profile into instrumentation
BREAKING CHANGE

Before

import * as p from 'angular2/profile';
import * as t from 'angular2/tools';

After

import * as p from 'angular2/instrumentation';
import * as t from 'angular2/platform/browser';
2015-11-24 19:29:52 +00:00
Alex Rickabaugh cee67e6fe0 Revert "feat(router): allow linking to auxiliary routes"
This reverts commit 0b1ff2db9e.
2015-11-23 16:34:40 -08:00
Alex Rickabaugh a3353a5e28 Revert "test(router): remove View decorator in router link fixtures"
This reverts commit 422a7b18f6.
2015-11-23 16:34:06 -08:00
Alex Rickabaugh c5294c77d9 Revert "refactor(router): improve recognition and generation pipeline"
This reverts commit cf7292fcb1.

This commit triggered an existing race condition in Google code. More work is needed on the Router to fix this condition before this refactor can land.
2015-11-23 16:26:47 -08:00
vsavkin ba64b5ea5a fix(forms): scope value accessors, validators, and async validators to self
Closes #5440
2015-11-23 23:48:54 +00:00
Matias Niemelä 564642d859 chore(core): rename `classname` to `className`
Closes #5371
2015-11-23 22:43:01 +00:00
Matias Niemelä 87549c77d4 chore(core): proper camelcasing for `styleName` and `styleValue` 2015-11-23 22:43:01 +00:00
Matias Niemelä fad354904d test(matchers): add support for `toHaveCssStyle` matcher 2015-11-23 22:43:01 +00:00
Rob Wormald e1d7bdcfe7 fix(http): Fix all requests defaulting to Get
Honor method parameter passed to http.request().

Closes #5309

Closes #5397
2015-11-23 22:17:13 +00:00
Rob Wormald 46fc153f39 fix(http): return URL in Response
Attach reponseURL or X-Request-URL to Response.

Closes  #5165
2015-11-23 22:17:13 +00:00
Rob Wormald 4332ccf72c fix(http): return Response headers
Properly parse and add response Headers to Response.

Closes #5237
2015-11-23 22:17:13 +00:00
Rob Wormald 201f189d0e fix(http): error on non-200 status codes
BREAKING CHANGE:

previously http would only error on network errors to match the fetch
specification. Now status codes less than 200 and greater than 299 will
cause Http's Observable to error.

Closes #5130.
2015-11-23 22:17:13 +00:00
Tim Ruffles 9ca8a35553 docs(core): @View annotations are no longer mandatory
@View is [now optional](angular@bd31b01).

Closes #5413
2015-11-23 19:55:43 +00:00
mlaval 5806babb0b chore(build): increase timeout of the 5 most flaky tests
Closes #5410
2015-11-23 19:23:25 +00:00
vsavkin 30d35b5046 fix(build): do not reexport compiler from angular2/angular2
Closes #5422
2015-11-23 18:57:15 +00:00
Brian Ford cf7292fcb1 refactor(router): improve recognition and generation pipeline
This is a big change. @matsko also deserves much of the credit for the implementation.

Previously, `ComponentInstruction`s held all the state for async components.
Now, we introduce several subclasses for `Instruction` to describe each type of navigation.

BREAKING CHANGE:

Redirects now use the Link DSL syntax. Before:

```
@RouteConfig([
  { path: '/foo', redirectTo: '/bar' },
  { path: '/bar', component: BarCmp }
])
```

After:

```
@RouteConfig([
  { path: '/foo', redirectTo: ['Bar'] },
  { path: '/bar', component: BarCmp, name: 'Bar' }
])
```

BREAKING CHANGE:

This also introduces `useAsDefault` in the RouteConfig, which makes cases like lazy-loading
and encapsulating large routes with sub-routes easier.

Previously, you could use `redirectTo` like this to expand a URL like `/tab` to `/tab/posts`:

@RouteConfig([
  { path: '/tab', redirectTo: '/tab/users' }
  { path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

Now the recommended way to handle this is case is to use `useAsDefault` like so:

```
@RouteConfig([
  { path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

@RouteConfig([
  { path: '/posts', component: PostsCmp, useAsDefault: true, name: 'Posts' },
  { path: '/users', component: UsersCmp, name: 'Users' }
])
TabsCmp { ... }
```

In the above example, you can write just `['/Tab']` and the route `Users` is automatically selected as a child route.

Closes #4170
Closes #4490
Closes #4694
Closes #5200

Closes #5352
2015-11-20 23:18:43 +00:00
Brian Ford 422a7b18f6 test(router): remove View decorator in router link fixtures 2015-11-20 23:18:43 +00:00
Brian Ford 0b1ff2db9e feat(router): allow linking to auxiliary routes
Closes #4694
2015-11-20 23:18:43 +00:00
Yegor Jbanov a43ed79ee7 feat(parser): allows users install custom AST transformers
Closes #5382
2015-11-20 19:46:02 +00:00
vsavkin 125fa3885e cleanup: removes the render and lifecycle_hooks modules
BREAKING CHANGE

Before

import {Renderer} from 'angular2/render';

After

import {Renderer} form 'angular2/core';

Closes #5367
2015-11-20 19:16:38 +00:00
Olivier Combe ae58934d52 docs(async): adding type to EventEmitter now that it is generic
Closes #5391
2015-11-20 00:20:12 +00:00
vsavkin 3c8fa8c50d cleanup: move DomAdapter from angular2/core into angular2/platform/common_dom
BREAKING CHANGE

Before

import {DomAdapter} from 'angular2/core';

After

import {DomAdapter} from 'angular2/platform/common_dom';

Closes #5370
2015-11-20 00:14:24 +00:00
Marc Laval 4d59985b74 chore(build): use Chrome by default for all JS tests
Fixes #5380

Closes #5387
2015-11-19 23:27:42 +00:00
vsavkin 5ba9ced1ab cleanup(core): stop reexporting angular2/common from angular2/core
All common directives, forms, and pipes have been moved out of angular2/core,
but we kept reexporting them to make transition easier.

This commit removes the reexports.

BREAKING CHANGE

Before

import {NgIf} from 'angular2/core';

After

import {NgIf} from 'angular2/common';

Closes #5362
2015-11-19 19:54:27 +00:00
Victor Berchet 36a423fac8 feat(Compiler): case sensitive html parser
close #4417
Closes #5264
2015-11-19 18:55:04 +00:00
Tobias Bosch adb87562bb feat(Compiler): case sensitive html parser 2015-11-19 18:55:04 +00:00
vsavkin 3c43a8c549 feat(bootstrap): add platform and app initializers
Often some init logic needs to run when a platform or an application is boostrapped.
For example, boostraping a platform requires initializing the dom adapter.
Now, it can be done as follows:

new Provider(PLATFORM_INITIALIZER, {useValue: initDomAdapter, multi: true}),

All platform initializers will be run after the platform injector has been created.

Similarly, all application initializers will be run after the app injector has been
created.

Closes #5355
2015-11-18 22:22:32 +00:00
Rob Wormald 3fa287aae2 refactor(EventEmitter): rename .next() to .emit()
BREAKING CHANGE:

EventEmitter#next(value) is deprecated, use EventEmitter#emit(value)
instead.

Closes #4287

Closes #5302
2015-11-18 22:16:40 +00:00
Jeremy Elbourn 929abb9aa3 chore(router): add tests for interaction between router-outer and
@ViewChild.

Closes #5164
2015-11-18 21:23:08 +00:00
vsavkin 2c8fcec432 refactor(core): move render/dom from core
Currently, core depends on DomRenderer, which depends on the browser.
This means that if you depend on angular2/core, you will always
pull in the browser dom adapter and the browser render, regardless
if you need them or not.

This PR moves the browser dom adapter and the browser renderer out of core.

BREAKING CHANGE

If you import browser adapter or dom renderer directly (not via angular2/core),
you will have to change the import path.
2015-11-17 15:53:55 -08:00
Naomi Black d013fc7604 docs(cleanup): fix bad h3 markup and normalize headings
Closes #5341
2015-11-17 22:10:20 +00:00
Brian Ford ac38812809 fix(router): apply APP_BASE_HREF when using PathLocationStrategy
Correctly initializes APP_BASE_HREF, and falls back to the `<base>` tag in the absence
of an APP_BASE_HREF provider.

Closes #5028
2015-11-17 21:19:22 +00:00
Igor Minar bcd926adc5 fix(http): refactor 'require' statements to 'import' declarations for Rx
Looks like this is some old leftover code from the times when Rx didn't distribute typings via npm.

Closes #5287
2015-11-17 01:26:54 +00:00
Alex Rickabaugh b22eddf1cb fix(core): Run component disposal before destroyRootHostView() to avoid crash if change detection is triggered.
Closes #5226
2015-11-17 00:58:13 +00:00
Victor Berchet 857bef9e4f doc(NgSwitch): update API doc
Closes #4423
2015-11-17 00:54:32 +00:00
vsavkin 4e585bca28 feat(build): add an option to disable type checks when running tests
Since editors and IDEs do typechecking and show errors in place,
often there is no benefit to running type checking in our test pipeline.
This PR allows you to disable type checking:

gulp test.unit.js --noTypeChecks

This commit also makes es6 generation optional.

fix(build): removes unnecessary circular dependencies

Closes #5299
2015-11-17 00:45:49 +00:00
Alex Rickabaugh 94cf671c15 docs(pipes): Add examples for all Angular pipes.
Closes #5103
2015-11-17 00:15:17 +00:00
vsavkin ad6fb067e9 fix(dart): fix the static_browser platform not to include compiler
Closes #5321
2015-11-16 23:29:36 +00:00
Peter Bacon Darwin c03fb36e11 docs(cheatsheet): add missing bootstrapping section
Closes #5269

Closes #5269
2015-11-16 23:15:03 +00:00
vsavkin 4e1d9c93df Revert "feat(Compiler): case sensitive html parser"
This reverts commit 86aeb8be0a.
2015-11-16 14:37:00 -08:00
vsavkin 0611239a0e Revert "feat(Compiler): case sensitive html parser"
This reverts commit a8edc1eb58.
2015-11-16 14:36:39 -08:00
Victor Berchet a8edc1eb58 feat(Compiler): case sensitive html parser
close #4417

Closes #5264
2015-11-16 21:09:09 +00:00
Tobias Bosch 86aeb8be0a feat(Compiler): case sensitive html parser 2015-11-16 21:09:09 +00:00
vsavkin e274ff8a69 Revert "feat(renderer): use a comment instead of an element when stamping out `<template>` elements"
This reverts commit bb9cfe6f36.
2015-11-16 11:15:28 -08:00
Tobias Bosch bb9cfe6f36 feat(renderer): use a comment instead of an element when stamping out `<template>` elements
Closes #4805


Closes #5227
2015-11-14 01:04:20 +00:00
Wassim Chegham b16fa45d83 docs(*): onContentInit --> afterContentInit
Closes #5263
2015-11-13 23:25:02 +00:00
Igor Minar 1d9c44b34f build: add --projects a.k.a the turbo button
we can now filter build graph via --project flag to speed up build performance

usage:

gulp test.unit.js --project=angular2,angular2_material

Closes #5272
2015-11-13 22:50:38 +00:00
vsavkin 0eab4fc72c feat(core): extract platforms out of core
Currently, core depends on the browser, which means that other platforms (e.g., NativeScript or webworker) cannot use the bootstrapping logic core provides.
This PR extract makes bootstrapping logic in core completely platform-independent. The browser-specific code was moved to "angular2/platforms/browser".

BREAKING CHANGE

A few private helpers (e.g., platformCommon or applicationCommon) were removed or replaced with other helpers. Look at PLATFORM_COMMON_PROVIDERS, APPLICATION_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS to see if they export the providers you need.

Closes #5219

Closes #5280
2015-11-13 19:26:14 +00:00
Alex Eagle 7f6289c1bf fix(typings): two errors not reported by our build:
third_party/javascript/angular2/github/modules/angular2/src/core/platform_bindings.ts:5:14: Exported variable 'EXCEPTION_PROVIDER' has or is using name 'Provider' from external module third_party/javascript/angular2/github/modules/angular2/src/core/di/provider but cannot be named.
third_party/javascript/angular2/github/modules/angular2/src/core/platform_bindings.ts:8:14: Exported variable 'EXCEPTION_BINDING' has or is using name 'Provider' from external module third_party/javascript/angular2/github/modules/angular2/src/core/di/provider but cannot be named.
third_party/javascript/angular2/github/modules/angular2/src/mock/animation_builder_mock.ts:11:10: Return type of public method from exported class has or is using private name 'MockCssAnimationBuilder'.
2015-11-12 18:39:23 -08:00
vsavkin 78280a48af Revert "feat(core): extract platforms out of core"
This reverts commit 3f4628c0b0.
2015-11-12 13:40:29 -08:00
vsavkin 3f4628c0b0 feat(core): extract platforms out of core
Currently, core depends on the browser, which means that other platforms (e.g., NativeScript or webworker) cannot use the bootstrapping logic core provides.
This PR extract makes bootstrapping logic in core completely platform-independent. The browser-specific code was moved to "angular2/platforms/browser".

BREAKING CHANGE

A few private helpers (e.g., platformCommon or applicationCommon) were removed or replaced with other helpers. Look at PLATFORM_COMMON_PROVIDERS, APPLICATION_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS to see if they export the providers you need.

Closes #5219
2015-11-12 16:57:03 +00:00
ericmartinezr 4e02e00373 feat(NgClass) allow multiple classes per expression
Closes #5225
2015-11-12 14:54:02 +00:00
Peter Bacon Darwin 9b3b721f08 docs(*): more cheatsheet docs 2015-11-11 16:32:25 -08:00
Peter Bacon Darwin 756727b930 docs(*): more cheatsheet docs 2015-11-11 16:32:25 -08:00
Peter Bacon Darwin 533b722c66 docs(*): move cheatsheet stuff into its own files 2015-11-11 16:32:25 -08:00
Peter Bacon Darwin 029c0534f3 docs(*): add initial cheatsheet tags 2015-11-11 16:32:25 -08:00
Igor Minar 4a43230de4 fix(core): various dart-specific fixes for core and facades
For some reason these showed up only now in internal Dart analyzer output.
2015-11-11 11:45:58 -08:00
Igor Minar 01ebff4080 fix(core): reexport PLATFORM_DIRECTIVES and PLATFORM_PIPES in dart
Looks like we missed this in the original PR.
2015-11-11 11:45:58 -08:00
Tobias Bosch 344776f864 fix(renderer): apply host element encapsulation also if the parent component is not encapsulated.
Closes #5240
2015-11-11 10:53:22 -08:00
Alex Rickabaugh a3e6406b38 fix(core): Export dev mode API in Dart.
Closes #5233
2015-11-11 07:18:11 +00:00
Alex Rickabaugh 1ff1792642 fix(core): Unload components when individually disposed. 2015-11-10 12:15:47 -08:00
Tobias Bosch e6bf33efbf patch(renderer): make `glyph` not an svg element
This is required because of a conflict with an internal project.
This will go away soon as we are working on a proper SVG 
support..
2015-11-10 11:51:39 -08:00
mlaval ee07646059 chore(test): fix public API test failure when no support of Symbol.for
`@@observable` is the token used in RxJS to define `Symbol.observable`

Closes #5093
2015-11-10 11:23:01 +01:00
vsavkin e27665c368 feat(core): renam AMBIENT_DIRECTIVES and AMBIENT_PIPES into PLATFORM_DIRECTIVES and PLATFORM_PIPES
After discussing it we decided that PLATFORM_ is a better prefix for directives available everywhere in the app.

BREAKING CHANGE

AMBIENT_DIRECTIVES -> PLATFORM_DIRECTIVES
AMBIENT_PIPES -> PLATFORM_PIPES

Closes #5201
2015-11-10 01:45:25 +00:00
Jeremy Elbourn 2618becaa5 chore(): npm release script for router artifacts.
Closes #5171
2015-11-09 20:45:55 +00:00
Victor Berchet 0dcca1a28e refactor(ListWrapper): drop filter, find, reduce & any
Closes #5152
2015-11-09 19:24:14 +00:00
Tobias Bosch e667ad3e6b refactor(compiler): make all commands const
Closes #5135
2015-11-09 10:59:08 -08:00
Tobias Bosch fb8b8157ff fix(setup): set tsconfig so that it works in editors 2015-11-09 08:43:15 -08:00
Alex Rickabaugh a8d9dbf110 feat(dart): Support forcing dev mode via enableDevMode in Dart.
Closes #5193
2015-11-09 07:16:25 +00:00
Trotyl Yu 2645fb0d6c docs(form): Fix typos of indent
Closes #5159
2015-11-07 16:05:56 +00:00
vsavkin 79472b77ca refactor(core): move facades out of core
This is part of ongoing work to make core platform-independent.

BREAKING CHANGE

All private exports from 'angular2/src/core/facade/{lang,collection,exception_handler}' should be replaced with 'angular2/src/facade/{lang,collection,exception_handler}'.
2015-11-07 01:36:06 +00:00
Yegor Jbanov 3593d85807 fix: remove deprecated zone API usage in testability
Closes #5084
2015-11-07 00:13:29 +00:00
Tobias Bosch 6133f2c08b fix(compiler): don’t lowercase attributes to support svg
This reverts commit b89c5bc581 and adds an additional test.

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

Closes #4560
2015-11-06 11:59:03 -08:00
Pawel Kozlowski 2d0c8f1b0e fix(NgFor): allow default templates with ng-for-template
Closes #5161
2015-11-06 19:26:02 +00:00
Pawel Kozlowski c6ad269f43 chore(build): remove es5build.js
Fixes #5030

Closes #5144
2015-11-06 18:22:57 +00:00
Victor Berchet a0a627f2f9 refactor(StringWrapper): remove useless methods
Closes #5039
2015-11-06 17:04:01 +00:00
Pawel Kozlowski 253e2b2285 refactor(router): don't import public APIs from internal paths
Closes #5139
2015-11-06 07:57:35 +00:00
Alex Rickabaugh aa70275b01 chore(tests): Enable dev mode in all Angular tests.
Closes #5106
2015-11-06 07:07:04 +00:00
Alex Rickabaugh 0b11051ac1 fix(material): Disable md-grid-list tests until #5132 is fixed. 2015-11-06 07:07:04 +00:00
Alex Rickabaugh 4bb9c46cf1 fix(core): Provide setDevMode() to enable/disable development mode in Javascript. 2015-11-06 07:07:04 +00:00
vsavkin 7343ef04ae feat(forms): remove controlsErrors
BREAKING CHANGE

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

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

Closes #5102
2015-11-06 01:47:37 +00:00
vsavkin 4439106a1f feat(facade): add support for async validators returning observables
Closes #5032
2015-11-06 01:20:03 +00:00
vsavkin 2c201d3f34 feat(facade): add a way to convert observables into promises 2015-11-06 01:20:03 +00:00
vsavkin fc50829481 feat(facade): add a way to detect if an object is a Promise 2015-11-06 01:20:03 +00:00
vsavkin 695923dcd6 refactor(core): move directives, pipes, and forms into common
BREAKING CHANGE

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

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

All imports from 'angular2/core/compiler' should be changed to 'angular2/compiler'.
2015-11-05 14:44:52 -08:00
Alex Rickabaugh f21e78244f feat(forms): Use the DefaultValueAccessor for controls with an ng-default-control attribute.
Third party controls require a ControlValueAccessor to function with Angular Forms. Many of them, like Polymer's <paper-input>, behave like the <input> native element and thus can use the DefaultValueAccessor. Adding an ng-default-control attribute will now allow them to use that directive.

Closes #5076
2015-11-05 19:53:46 +00:00
Alex Rickabaugh fee5dea826 fix(forms): Export the NG_VALUE_ACCESSOR binding token.
This is needed to allow component authors to implement custom ControlValueAccessors for their input components.
2015-11-05 19:53:46 +00:00
Victor Berchet b84855f394 refactor: private methods should not be decorated with internal
Closes #5146
2015-11-05 19:28:30 +00:00
Victor Berchet 7e92d2e6b7 feat(ChangeDetector): Add support for short-circuiting 2015-11-05 19:28:30 +00:00
Victor Berchet b91351469f refactor(ChangeDetector): misc minor updates 2015-11-05 19:28:30 +00:00
Victor Berchet c56efc0c5f refactor(ChangeDetector): use View/ShadowDom & Content/LightDom consistently 2015-11-05 19:28:30 +00:00
vsavkin 4909feddde feat(core): add support for ambient directives to dart transformers
Closes #5129
2015-11-05 17:26:57 +00:00
vsavkin adc0e32cff refactor(examples): update the Zippy example to rely on ambient directives 2015-11-05 17:26:57 +00:00
mgechev f54ba3cc1b docs(query_list): update highlight language
Closes #5029
2015-11-05 08:55:25 +00:00
Pawel Kozlowski f1989e7e1c fix(compiler): remove style when [style.foo]='exp' evaluates to null
Fixes #5110

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

Closes #4233
Closes #5082
2015-11-04 19:55:46 +00:00
Rob Wormald a9b1270a5a fix(http): use Observable<Response> on Http methods
use correct type definitions for Http responses.

Closes #5017
2015-11-04 19:19:50 +00:00
Rob Wormald 31687efd64 fix(http): use Response for JSONP errors
Return Response when JSONP backend errors
2015-11-04 19:19:50 +00:00
Peter Bacon Darwin 69e4b62809 docs(onDestroy): fix broken backticks
Closes #5089
2015-11-04 17:51:32 +00:00
Julie Ralph d0c65c144a for fixup - keep RootTestComponent around, but deprecate 2015-11-03 14:56:23 -08:00
Julie Ralph 686457890d chore(test): rename RootTestComponent to ComponentFixture
BREAKING CHANGE:

Before:

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

After:

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

Closes #4711
2015-11-03 14:56:22 -08:00
mlaval a16214c614 chore(test): failures in browsers which do no support Symbol.iterator
Closes #5069
2015-11-03 21:27:16 +00:00
vsavkin 62402457a2 fix(playground): fix the inbox example 2015-11-03 11:16:18 -08:00
vsavkin 5948abab7a feat(core): add support for ambient directives
Ambient directives can be configured when bootstraping an application.
Ambient directives can be used in every component of the application without
needing to explicitly list them.
2015-11-03 07:54:29 -08:00
vsavkin 045919b595 refactor(playground): update Zippy to use @Input and @Output 2015-11-03 00:46:54 +00:00
vsavkin 6f1a89e3a9 refactor(playground): update the order management example to use the recommended APIs 2015-11-03 00:46:54 +00:00
vsavkin 134c6f57d5 refactor(playground): update Zippy to use @Input and @Output 2015-11-03 00:46:54 +00:00
vsavkin bf07f9c3e1 refactor(playground): update the order management example to use the recommended APIs 2015-11-03 00:46:54 +00:00
Yegor Jbanov c814dfbfa5 fix: remove internal usages of deprecated overrideOnTurnDone
Closes #5079
2015-11-02 23:46:20 +00:00
Yegor Jbanov 8dc079eee5 docs: add @Input/@Output to deprecation messages 2015-11-02 14:48:23 -08:00
Yegor Jbanov c4129071ef docs(metadata): provide deprecation messages 2015-11-02 14:48:22 -08:00
vsavkin 1c322f13e5 feat(forms): update FormBuilder to support async validations
Closes #5020
2015-11-02 18:03:03 +00:00
vsavkin 31c12af81f feat(forms): add support for adding async validators via template
Example:

@Directive({
  selector: '[uniq-login-validator]',
  providers: [provide(NG_ASYNC_VALIDATORS, {useExisting: UniqLoginValidator, multi: true})]
})
class UniqLoginValidator implements Validator {
  validate(c) { return someFunctionReturningPromiseOrObservable(); }
}
2015-11-02 18:03:03 +00:00
vsavkin cf449ddaa9 feat(forms): implements a combinator for composing async validators 2015-11-02 18:03:02 +00:00