4358 Commits

Author SHA1 Message Date
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 
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
Alex Eagle
db95fd6ca9 build(offline compiler): package the compiler-cli for users
Closes 
2016-05-02 00:38:54 +00:00
vsavkin
ca13f1c024 fix(router): create a route tree when creating the router service
Closes 
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
Alex Eagle
6f5e3f9390 Update evaluator.spec.ts
Fix stray `fit` that skips tools tests
Closes 
2016-05-01 18:43:32 +00:00
Alex Eagle
a84c2d7fee fix(typescript): strip abstract keyword from properties in .d.ts
Fixes angular2/src/alt_router/metadata/metadata.d.ts

Closes 
2016-05-01 02:59:15 +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 
2016-05-01 02:30:33 +00:00
Tobias Bosch
163d80adb7 fix(compiler_cli): make sure the generated code gets compiled via tic 2016-05-01 02:30:33 +00:00
Tobias Bosch
9e05814212 chore: move StaticReflector into compiler_cli, part 2
Adjust tests and build to run the unit tests again
after the move.
Closes 
2016-04-30 20:53:54 +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 
2016-04-30 19:47:54 +00:00
Tobias Bosch
4e2c68354e chore: update ts2dart to 0.9.10 2016-04-30 19:47:54 +00:00
vsavkin
62a0809e81 feat(router): listen to location changes
Closes 
2016-04-30 19:02:14 +00:00
vsavkin
76d6f5fa0d fix(router): canDeactivate should not change the url when returns false
Closes 
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
Gautam krishna.R
e589f9949b chore: align badges in README.md 2016-04-30 08:47:49 -07:00
Tobias Bosch
0f774df811 fix(compiler): project using the right directive as component.
Closes 
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 
2016-04-29 18:30:29 -07:00
Tobias Bosch
11955f9b13 fix(compiler): support empty array and map literals.
This was broken after 152a117d5c27e56d1b32d69df2f69d34b94c0760

Fixes 
2016-04-29 18:30:29 -07:00
vsavkin
5ff31f0713 build(router): create alt_router bundle 2016-04-29 18:05:36 -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
Martin Probst
d097784d57 chore: adjust public API spec to API changes. 2016-04-29 17:34:32 -07:00
Tobias Bosch
15f6b27ae0 refactor(compiler): support referenced OpaqueTokens 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 
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 a0b5964a63ab3680703adc336aab196444e9a43d.
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 
2016-04-29 01:22:13 -07:00
Alex Eagle
96ae348648 chore(build): fix formatting and tests
Closes 
2016-04-28 23:59:06 -07:00
Alex Eagle
78946fe9fa feat(offline compiler): a replacement for tsc that compiles templates
see .
2016-04-28 21:57:16 -07:00
Alex Eagle
33e53c9a59 chore(compiler): add dependency on tsickle
This tool lets us re-write TypeScript sources before entering the emit pipeline.
For example, we lower Decorators to the tree-shakable Annotation form.
2016-04-28 21:55:18 -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 
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
Chuck Jazdzewski
7c0d4976b1 fix(8223): Preserve Provider expressions
Preserves constructor calls in addition to function calls.
Introduced a special case for forwardRef() similar to CONST_EXPR.
2016-04-28 21:31:28 -07:00
vsavkin
30de2db349 cleanup(router): make analyzer happy
Closes 
2016-04-29 02:45:57 +00:00