Commit Graph

469 Commits

Author SHA1 Message Date
Tobias Bosch 6fcd3709cf fix(render): return views when destroyed in ViewContainer
Closes #1316
2015-04-27 17:39:09 -07:00
Brian Ford 1b2754dacd feat(router): add initial implementation 2015-04-27 17:15:58 -07:00
Tim Blasi 15376a6d24 feat(dart/transform): Dedup getters, setters, & methods
Dedup the getters, setters, and methods generated by the transformer
when compiling a template.

Run `dartformat` over the transform code.
2015-04-27 17:04:31 -07:00
Tim Blasi 99fdb9ac41 fix(dart/transform): Use `var` instead of `bool` in generated files
If a source file hides `bool` (explicitly or implicitly via `show`), a
generated file using `bool` may not resolve.

Closes #1455
2015-04-27 14:23:24 -07:00
Tobias Bosch 6dece68bb8 refactor(core): rename ViewContainer to ViewContainerRef
This also renames InternalAppViewContainer into AppViewContainer

Related to #1477
Closes #1554
2015-04-27 10:12:21 -07:00
Tobias Bosch bfa381b35a refactor(view): introduce AppViewManager to consolidate logic
AppViewManager is the single entry point to changing the view hierarchy.
It is split between the manager itself which does coordination and
helper methods, so both are easily testable in isolation.

Also, ViewContainer is now only a pure reference to a bound element
with the previous functionality but does not contain the list of views
any more.

Part of #1477
2015-04-24 20:26:18 -07:00
Tobias Bosch f78406392b fix(test_lib): support multi matches with deep equality for function calls 2015-04-24 17:53:41 -07:00
Pawel Kozlowski 4bab25b366 feat: alllow specifying directives as bindings
Related to #709
Closes #1498
2015-04-24 11:02:17 -07:00
vsavkin 8ccafb0524 feat(view): reimplemented property setters using change detection 2015-04-23 11:55:27 -07:00
Pawel Kozlowski d0059b5d75 refactor(PipeRegistry): improve error messages
Closes #1504
2015-04-23 11:04:30 -07:00
Pawel Kozlowski afe0e45453 feat(parser): support === and !== operators
Closes #1496

Closes #1500
2015-04-23 20:01:31 +02:00
Victor Berchet 2e3e41ba64 fix(ListWrapper): follow JS semantics 2015-04-23 09:46:09 +02:00
Marc Laval 22c6c09daf chore(build): run event tests in Node
Closes #1476
2015-04-21 16:21:39 -07:00
Pawel Kozlowski e23004df52 fix(di): capture original exception in InvalidBindingError
Fixes #1406

Closes #1459
2015-04-21 10:59:44 +02:00
Tobias Bosch ada1e642c5 feat(view): add imperative views 2015-04-20 17:18:44 -07:00
vsavkin a97a2266d3 feat(change_detection): added async pipe 2015-04-20 14:50:23 -07:00
vsavkin 2d929e73ec cleanup(change_detection): moved pipes-related tests to the pipes dir 2015-04-20 14:24:15 -07:00
vsavkin 681d06386d feat(view): implemented loading component next to existing location 2015-04-20 13:41:10 -07:00
Tim Blasi 77b31ab42f feat(dart/transform): Add debug transform parameters
Add two transform parameters to aid in debugging the transformer
- `mirror_mode`, with values {`debug`, `none`, and `verbose`}
- `init_reflector`, with values {`true`, `false`}

`mirror_mode`:
- `debug`: Allow reflective access, but log a message if it is used
- `none`: Remove reflective access, `throw` if it is used. Default value
- `verbose`: Allow reflective access, log a stack trace if it is used

`init_reflector`: Whether to generate calls to our generated
`initReflector` code.

These will be useful to reveal areas where the transformer is not generating
appropriate code and to quickly see where reflective accesses occur.

When the pub mode is `transform_dynamic`, we run in MirrorMode.debug
with `init_reflector = false`. This is used for testing purposes.
2015-04-20 12:32:04 -07:00
Naomi Black 5c25248582 docs(x-ref links): Change links to use dgeni syntax
Closes #1440
2015-04-20 18:45:04 +00:00
Tobias Bosch 64ad74acbe fix(shadowdom): remove unused nodes on redistribute
Previously, light dom nodes that were not used by any content tag
were not removed from a view on redistribute. This lead
to a bug when reusing a view from the view pool, as it
still contained stale reprojected nodes.

Fixes #1416
2015-04-20 11:36:39 -07:00
Tobias Bosch 02997f473a fix(viewFactory): allow empty view cache 2015-04-20 11:36:39 -07:00
Marc Laval 883e1c1541 feat(events): support preventdefault
Fixes #1039
Closes #1397
2015-04-20 15:20:52 +02:00
vsavkin 56f3429cc9 fix(view): chagned view factory to keep AstWithSource 2015-04-17 17:40:43 -07:00
vsavkin 4943c0f887 fix(view): fixed hydrator to pass the right element index when attaching an event listener 2015-04-17 17:27:12 -07:00
Yegor Jbanov 526c51d1a6 fix(facades): fix splice semantics; add test 2015-04-17 13:52:03 -07:00
Tobias Bosch f830cfca12 refactor(view): provide ViewContainers dynamically on any element 2015-04-17 12:35:59 -07:00
vsavkin eac5c88893 fix(view): fixed hydrator to export the dom element instead of ng element 2015-04-17 12:32:33 -07:00
Misko Hevery 87ac100c66 docs: add DI to public docs 2015-04-17 03:56:17 +00:00
vsavkin 5408abca68 refactor(change_detection): removed global change detection objects so it is possible to override pipe registry 2015-04-16 15:57:45 -07:00
vsavkin 233cb0f96a feat(view): changed event emitters to be observables 2015-04-16 14:44:14 -07:00
Tobias Bosch 923d90bce8 refactor(views): clean up creating views in place and extract view_hydrator
Major changes:
- `compiler.compileRoot(el, type)`
  -> `compiler.compileInHost(type) + viewHydrator.hydrateHostViewInPlace(el, view)`
- move all `hydrate`/`dehydrate` methods out of `View` and `ViewContainer` into
  a standalone class `view_hydrator` as private methods and provide new public
  methods dedicated to the individual use cases.

Note: This PR does not change the current functionality, only moves it
into different places.

See design discussion in #1351, in preparation for imperative views.
2015-04-16 11:58:01 -07:00
vsavkin 97fc248e00 cleanup(di): changed an error message to be more descriptive 2015-04-16 11:06:20 -07:00
vsavkin 7bd682bb27 feat(parser): changed parser to parse pipes in the middle of a binding 2015-04-16 10:39:03 -07:00
Tim Blasi e927342e58 Read only a single DirectiveMetadata (will be squashed) 2015-04-16 09:11:03 -07:00
Tim Blasi ae84eb7462 refactor(dart/transform): Correct Dart analyzer warnings 2015-04-16 09:11:03 -07:00
Tim Blasi f89bb8eaf3 Address code review comments 2015-04-16 09:11:03 -07:00
Tim Blasi 0d0b3a35da test(dart/transform): Add unit tests for DirectiveMetadataReader 2015-04-16 09:11:03 -07:00
Tim Blasi cf7bef58b0 feat(dart/transform): Add the DirectiveMetadataReader
Add a class that parses and reads Directive metadata to prepare for
running the Render compiler in the Dart transformer.
2015-04-16 09:11:02 -07:00
Jacob MacDonald c65fd31e86 feat(dart/transform): Detect annotations which extend Injectable or Template.
Create a method that recursively walks imports from an entry point and
determines where classes are registered.

Use this information to determine if a particular annotation implements or
extends Injectable or Template.
2015-04-16 07:17:24 -07:00
Kevin Moore 957384ceeb fix: Fix issues found by Dart analyzer 2015-04-15 20:58:29 -07:00
Marc Laval d3e391d176 chore(build): run render tests in Node
Closes #1358
2015-04-15 19:51:11 -07:00
vsavkin 68faddbf5c feat(change_detection): updated handling ON_PUSH detectors so they get notified when their bindings change 2015-04-15 16:21:21 -07:00
vsavkin 8c1adabe1c refactor(change_detection): renamed BindingPropagationConfig to ChangeDetectorRef 2015-04-15 12:58:58 -07:00
Tobias Bosch 213dabdceb fix(view): remove dynamic components when the parent view is dehydrated
Also adds a bunch of unit tests for affected parts.

Fixes #1201
2015-04-15 12:53:21 -07:00
Tobias Bosch 6ecaa9aebb feat(change detection): add removeShadowDomChild 2015-04-15 12:53:21 -07:00
Tobias Bosch cb2e646332 fix(tests): create default spys for all methods on a class 2015-04-15 12:53:20 -07:00
Tim Blasi fef1dee7aa fix(dart/transform): Ensure consistent ordering of generated imports
- Linked imports are generated in a consistent order.
- Linked imports are generated immediately after their associated files.
2015-04-15 12:09:51 -07:00
Tim Blasi 7cac7c5157 refactor(dart/transform): Correct Dart analyzer warnings
- Fix numerous Dart analyzer warnings we had been ignoring.
- Delete unused `in_progress` dir
2015-04-14 13:41:22 -07:00
vsavkin 8b97cf1479 cleanup(view): changed ComponentRef to contain ElementRef instead of extending it 2015-04-13 19:30:00 -07:00
vsavkin b5c9f9ed9b cleanup(element_injector): added a missing test 2015-04-13 19:30:00 -07:00
Yegor Jbanov 308823b6ea perf(view): use pre-resolved bindings for child injector init
Creating a child injector from pre-resolved bindings (if any) is an
order of magnitude faster.
2015-04-13 15:06:44 -07:00
Yegor Jbanov 4a961f4ecb feat(di): provide two ways to create an injector, resolved and unresolved
Add two factory static functions to Injector: resolveAndCreate and
fromResolvedBindings.

We want to avoid resolution and flattening every time we create a new
injector. This commit allows the user to cache resolved bindings and
reuse them.
2015-04-13 15:06:43 -07:00
Yegor Jbanov 6c8398df9b fix(di): refactor bindings to support Dart annotations 2015-04-13 15:06:43 -07:00
Marc Laval b96e560c8d feat(events): add support for global events
Fixes #1098
Closes #1255
2015-04-13 22:35:36 +02:00
Tobias Bosch 8499cf84c3 fix(shadow_dom): redistribute light dom when a dynamic component is attached.
Fixes #1077
Closes #1315
2015-04-13 09:23:52 -07:00
vsavkin 6f8fef4f13 feat(bootstrap): changed bootstrap to return ComponentRef 2015-04-10 18:14:59 -07:00
Tobias Bosch 6ce085a21a feat(benchmark): make view cache a parameter to the tree benchmark 2015-04-10 16:57:46 -07:00
Tobias Bosch e34146fc14 fix(view_factory): fix caching of views
Previous implementation had bugs, and did not cache per ProtoView.
2015-04-10 16:57:45 -07:00
Victor Berchet 678d541da7 refactor(compiler): add control.ignoreCurrentElement() to skip the current element
relates to #808
2015-04-10 23:34:05 +00:00
Tim Blasi f6e9d1f857 feat(dart/transform): Fix handling of Dart keywords
Use `package:analyzer`'s list of Dart keywords to ensure we are properly
reporting usages of Dart keywords as runtime errors.
2015-04-10 13:43:11 -07:00
Tim Blasi 2cab7c79c3 feat(dart/transform): Allow multiple transformer entry points
- Allow the user to specify multiple entry points to an app.
- Allow the Angular 2 transformer to run without explicit entry points to
generate necessary setters & getters on built-in directives like `For`
and `If`.

Closes #1246
2015-04-10 13:41:26 -07:00
Tim Blasi bba849909c fix(dart/transform): Gracefully handle log calls before init
- Lazily create and use a logger that prints instead of `throw`ing.
- Use this logger in unit tests.
2015-04-10 13:41:26 -07:00
Pawel Kozlowski bf7933714a chore(rename): rename View and Template concepts for #1244 2015-04-10 12:00:37 -07:00
David-Emmanuel Divernois 8fa1539bac feat(keyEvents): support for <div (keyup.enter)="callback()">
This commit adds a plugin for the event manager, to allow a key name to
be appended to the event name (for keyup and keydown events), so that
the callback is only called for that key.

Here are some examples:
 (keydown.shift.enter)
 (keyup.space)
 (keydown.control.shift.a)
 (keyup.f1)

Key names mostly follow the DOM Level 3 event key values:
http://www.w3.org/TR/DOM-Level-3-Events-key/#key-value-tables

There are some limitations to be worked on (cf details
in https://github.com/angular/angular/pull/1136) but for now, this
implementation is reliable for the following keys (by "reliable" I mean
compatible with Chrome and Firefox and not depending on the keyboard
layout):
- alt, control, shift, meta (those keys can be combined with other keys)
- tab, enter, backspace, pause, scrolllock, capslock, numlock
- insert, delete, home, end, pageup, pagedown
- arrowup, arrowdown, arrowleft, arrowright
- latin letters (a-z), function keys (f1-f12)
- numbers on the numeric keypad (but those keys are not correctly simulated
by Chromedriver)

There is a sample to play with in examples/src/key_events/.

close #523
close #1136
2015-04-10 13:29:27 +02:00
vsavkin f45281a10a feat(view): generalized loading of dynamic components 2015-04-09 22:15:42 -07:00
Rado Kirov e9f70293ac feat(query): adds initial implementation of the query api.
Queries allow a directive to inject a live list of directives of a given
type from its LightDom. The injected list is Iterable (in JS and Dart).
It will be Observable when Observables are support in JS, for now it
maintains a simple list of onChange callbacks API.

To support queries, element injectors now maintain a list of
child injectors in the correct DOM order (dynamically updated by
viewports).

For performance reasons we allow only 3 active queries in an injector
subtree. The feature adds no overhead to the application when not
used. Queries walk the injector tree only during dynamic view
addition/removal as triggered by viewport directives.

Syncs changes between viewContainer on the render and logic sides.

Closes #792
2015-04-09 19:07:19 -07:00
vsavkin 61cb99ea42 refactor(change_detection): removed directive and binding mementos 2015-04-09 18:56:19 -07:00
vsavkin 69c3bff086 feat(change_detection): updated change detection to update directive directly, without the dispatcher 2015-04-08 22:14:50 -07:00
Tobias Bosch 50098767fc refactor(render): use render layer fully
Introduces angular2/src/core/compiler/ViewFactory which
extracts ProtoView.instantiate and replaces ViewPool.

Note: This is a work in progress commit to unblock other commits.
There will be follow ups to add unit tests, remove TODOs, …
2015-04-08 20:51:31 -07:00
Pawel Kozlowski 41262f4265 feat(Ruler): introduce Ruler service
Closes #1089

Closes #1253
2015-04-08 11:04:42 +02:00
Tobias Bosch ca958464c4 refactor(render): create and store render ProtoViewRef in every app ProtoView
Needed to change Renderer.mergeChildComponentProtoViews to not create
new ProtoViews to be able to deal with cyclic references.

This commit is part of using the new render layer in Angular.
2015-04-07 20:27:25 -07:00
Pawel Kozlowski a3387b7f48 fix(di): allow injecting static attrs without type annotations
Closes #1226
2015-04-06 12:33:37 +02:00
Victor Berchet d8aeb40b49 reafactor(XHR): rename XHRMock to MockXHR for consistency 2015-04-06 10:30:16 +02:00
Victor Berchet 52c55d0ee8 test: convert to using TestBed 2015-04-06 10:30:16 +02:00
Victor Berchet 438c2b31e4 test(TestBed): initial implementation 2015-04-06 10:30:16 +02:00
Victor Berchet 57e308dd46 test(MockTemplateResolver): allow directive overriding 2015-04-06 10:07:50 +02:00
Tobias Bosch 1d4d18d9db refactor(render): user render compiler 2015-04-03 23:41:00 -07:00
Tim Blasi bc909d1d0f refactor(dart/transform): Minor renames
Rename `setupReflection` => `initReflector`
Rename `TemplateComplier` => `TemplateCompiler`

Closes #1180
2015-04-03 13:16:24 -07:00
vsavkin abea92af59 refactor(change_detection): call onChange from the change detector 2015-04-02 21:22:42 -07:00
Tobias Bosch c1aa65239e refactor(render): move services to render folder
property_setter_factory
selector
style_inliner
style_url_resolver
shadow_css
2015-04-02 14:40:49 -07:00
Tobias Bosch be5ccf6957 refactor(render): delete copies files so we add them via moves 2015-04-02 14:24:55 -07:00
Victor Berchet 1037cef22e refactor(render): misc minor fixes 2015-04-02 20:50:05 +02:00
Tim Blasi 09948f4403 feat(dart/transform): Add a `di` transformer
Add a transformer for `di` which generates `.ng_deps.dart` files for all
`.dart` files it is run on. These `.ng_deps.dart` files register
metadata for any `@Injectable` classes.

Fix unit tests for changes introduced by the di transformer.

When using `pub (build|serve) --mode=ngstatic`, we will also generate
getters and setters, parse templates, and remove import of `dart:mirrors`
in the Angular transform. Because this is still relatively immature, we
use the mode to keep it opt-in for now.

Closes #700
2015-04-02 11:06:33 -07:00
Tobias Bosch 4f56628566 refactor(render): move services to right location
core/compiler/events -> render/dom/events
core/compiler/url_resolver -> services/url_resolver
core/compiler/xhr/* -> services/*
2015-04-02 10:35:27 -07:00
Tobias Bosch bcbf1ccc68 refactor(render): remove duplicate files to prepare for move
Remove first so Github shows the files as being moved instead of copied and deleted.
2015-04-02 10:35:27 -07:00
Pawel Kozlowski ae30d7ba40 fix(di): allow injecting event emitter fns without specifying type annotation
Fixes #965

Closes #1155
2015-04-02 19:07:49 +02:00
Marc Laval 1d79d534d9 test(selector): add tests with multiple attributes
Fixes #1025
Closes #1117
2015-04-02 18:06:44 +02:00
Tobias Bosch 6c60c3e547 feat(render): add initial implementation of render layer 2015-04-01 16:50:22 -07:00
Julie Ralph e81e5fb2b9 feat(testability): add an initial scaffold for the testability api
Make each application component register itself onto the testability
API and exports the API onto the window object.
2015-04-01 13:54:06 -07:00
vsavkin 514ba54282 feat(change_detection): added changeDetection to Component 2015-03-31 20:54:44 -07:00
vsavkin b65b145122 refactor(view): refactored DirectiveMemento to expose properties in a consistent way 2015-03-31 18:26:58 -07:00
Martin Probst eb7b7581ca fix(build): Actually code in the subset of JS that Traceur-Dart supports. 2015-03-31 16:08:49 -07:00
Martin Probst 54a4e4a67c fix(dart): The Traceur dart transpiler doesn't support shorthand syntax. 2015-03-31 13:17:56 -07:00
Pawel Kozlowski aca4604879 feat(CSSClass): support binding to classList
Closes #876
2015-03-31 21:53:24 +02:00
Martin Probst 136f64f4ac fix(dart): don't instantiate abstract directive.
Directive is an abstract class, so it should not
be instantiated directly in tests.
2015-03-31 11:38:59 -07:00
Tim Blasi ed5975d3e5 test(dart/transform): Add unit tests for url-linked templates
Test expression and method generation from url-linked templates.
2015-03-30 14:49:31 -07:00
Tim Blasi 1a788e6b0d feat(dart/transform): Parse `url` values in `Template`s
When a `Template` annotation declares a `url` value, parse it to
generate `getter`s, `setter`s, and `method`s which will it needs to
access reflectively.
2015-03-30 14:49:31 -07:00
Marc Laval d822793229 fix(test): add a test for @PropertySetter on a class with a dash
Closes #1113
Fixes #1099
2015-03-28 16:17:43 +01:00
vsavkin e92918bbfe feat(change_detector): split light dom and shadow dom children 2015-03-27 13:26:37 -07:00
vsavkin 723e8fde93 feat(change_detection): added a directive lifecycle hook that is called after children are checked 2015-03-27 13:26:36 -07:00
Caitlin Potter 9d21a6f40d chore(package.json): upgrade traceur to v0.0.87
Fix in source-map test to follow through the sourcemap chain.
2015-03-26 18:37:03 -07:00
vsavkin 8d85b839b6 feat(change_detection): pass binding propagation config to pipe registry 2015-03-26 16:57:04 -07:00
Pawel Kozlowski 5306b6dd0c fix(change_detection): expose values when detecting changes in key-value pairs
Fixes #1118

Closes #1123
2015-03-26 21:18:14 +01:00
Pawel Kozlowski edc3709451 fix(ElementBinderBuilder): properly bind CSS classes with "-" in their names
Fixes #1057

Closes #1059
2015-03-26 19:25:31 +01:00
Victor Berchet 878fce6482 fix(ts): ts doesn't like ";;" 2015-03-26 17:32:48 +01:00
vsavkin b02bd65871 feat(forms): made forms works with single controls 2015-03-26 07:48:17 -07:00
vsavkin ee36aaf163 fix(tests): fixed a broken test 2015-03-26 07:46:26 -07:00
vsavkin ff84506bd5 feat(forms): added support for arrays of controls 2015-03-26 07:43:25 -07:00
Marc Laval b1dc6239ef feat(core): @Attribute annotation
Closes #1091
Fixes #622
2015-03-26 10:51:44 +01:00
Victor Berchet 3ec837bfdb test(di): Add a test for sync binding + resolved async dependency 2015-03-26 08:38:29 +01:00
Alex Eagle 9a0a2e319c chore(ts2dart) remove extra semi
This breaks our ts2dart transpilation.
2015-03-25 17:06:47 -07:00
Yegor Jbanov 99045b2f6a refactor: update Dart package dependencies 2015-03-25 15:54:12 -07:00
Marc Laval 58dd75a1c8 feat(compiler): Add support for setting attributes to Component host element
Fixes #1008
Fixes #1009
Closes #1052
2015-03-25 17:32:07 +01:00
Victor Berchet 101a4aa3cf feat(PrivateComponentLoader): Explicit error message when loading a non-component
fixes #1062
2015-03-24 22:11:41 +01:00
vsavkin 19c1773133 feat(forms): added an observable of value changes to Control 2015-03-24 13:45:47 -07:00
vsavkin 9b3b3d325f feat(facade): added support for observables 2015-03-24 13:45:39 -07:00
vsavkin f8e7a37c0d fix(view): fixed view instantiation to use the component template's change detector when creating BindingPropagationConfig 2015-03-24 07:49:28 -07:00
Victor Berchet aab084866c doc(test): add a comment on why tests are disabled 2015-03-24 09:52:41 +01:00
vsavkin 47c1a0f381 feat(forms): added value accessor for input=text 2015-03-23 08:53:27 -07:00
vsavkin 514529b5d9 refactor(formed): changed forms to use event and property setters instead of NgElement 2015-03-23 08:52:54 -07:00
vsavkin a12dc7d75a refactor(forms): wrapped all validators into the Validator class 2015-03-23 08:50:56 -07:00
Marc Laval 41b53e71e1 feat(selector): support , for multiple targets
Fixes #867
Closes #1019
2015-03-23 10:06:33 +01:00
Pawel Kozlowski 0fb9f3bd6c fix(ElementBinderBuilder): properly bind to web component properties
Fixes #776

Closes #1024
2015-03-22 14:14:36 +01:00
Pawel Kozlowski 81f3f32217 refactor(DirectiveParser): remove checks for missing directives
Based on the discussion in #776 we can't reliably check if a given
element has a particular property at the compilation time. As such
the existing algorithm detecting "missing" directives can't be used.

We need to see if there is a different / better algorithm or maybe
those checks need to be moved later in the process (runtime). Leaving
integration tests in place (disabled) so we can come back to the
topic after unblocking the situation.

This commit effectivelly reverts 94e203b9df
2015-03-22 14:14:36 +01:00
Tim Blasi b35f288794 refactor(dart/transform): Use package:guinness in tests
`guinness` is a Dart port of Jasmine. Since the rest of Angular 2 uses
Jasmine, use it for the transformer too.

Closes #8

Closes #1037

Closes #1000
2015-03-21 15:18:15 -07:00
Tim Blasi 4e82cc0861 refactor(dart/transform): Test `directive_linker` as a unit
Formerly, it was tested only as a piece of the transformer pipeline. Add
its own directory and test the linker on its own.
2015-03-21 15:18:15 -07:00
Tim Blasi c735644c57 refactor(dart/transform): Minor logging changes
Enable easier testing by providing a null log implementation and a way
to use it.
2015-03-21 15:18:15 -07:00
Tim Blasi 5d479fa0ae refactor(dart/transform): Remove `ngData`
Now that we have `Parser`, `ngData` is redundant & unnecessary.
2015-03-21 15:18:15 -07:00
Tim Blasi 8baedca972 style(dart/transform): Remove `src` from library directives
Conform to Angular 2 style by removing `src` from library directives.
Completed with:
```
find -name "*.dart" | xargs sed -i -e 's!library\(.*\)src\.\(.*\)!library \1\2!'
```

Closes #1005

Closes #1038
2015-03-21 14:55:11 -07:00
Marc Laval 02aa8e7945 feat(compiler): support bindings for any attribute
Closes #1029
2015-03-21 14:55:11 -07:00
Victor Berchet ee523efcb4 feat(ShadowCss): Support the new deep combinator syntax >>>
fixes #990

ref http://dev.w3.org/csswg/css-scoping-1/#deep-combinator

Closes #1028
2015-03-21 14:55:11 -07:00
David-Emmanuel Divernois bd48c927d0 fix(ViewContainer) removeChild called with null parent
In view_container.js, templateElement.parentNode can be null
when two template tags are nested in one another.
Accessing the parent node through view.nodes[0].parentNode fixes
the problem.

closes #997

Closes #999
2015-03-21 14:55:10 -07:00
gdi2290 b61b8d60b7 refactor(forEach): change to for-of with iterable
rename: foreach -> for
rename: array -> iterable
update: DartParseTreeWriter
update: naive_infinite_scroll
update: todo
fix: tests in foreach_spec

Closes #919
2015-03-21 14:19:21 -07:00
Marc Laval 2ff2ce3c6c refactor(test_lib): remove IS_NODEJS
Closes #1015
2015-03-20 15:50:05 +01:00
Marc Laval ab5ed6f2ec chore(test): clean tests of if directive
Closes #1017
2015-03-20 15:48:55 +01:00
vsavkin 8a10edec01 feat(forms): added pristine and dirty 2015-03-19 14:36:21 -07:00
vsavkin 906fba4fab fixed imports 2015-03-19 10:52:16 -07:00
vsavkin d220b6a2a4 test(forms): added a test checking support for select 2015-03-19 10:19:14 -07:00
vsavkin f42e6337b7 feat(forms): added support for textarea 2015-03-19 10:19:13 -07:00
Tim Blasi 08b56e1c53 feat(dart/transform): Add simple ParseTemplates step
Generate methods in the ParseTemplates step.
Add a test for inline template method generation.
2015-03-19 08:05:44 -07:00
Tim Blasi b3fa1fa4fa feat(dart/transform): Add simple ParseTemplates step
Adds a step that parses `inline` Template values to generate getters and
setters.
2015-03-19 07:06:51 -07:00
Pawel Kozlowski e0710c4613 fix(PropertyBindingParser): detect bindings using full attribute name
Fixes #1001

Closes #1004
2015-03-18 21:52:15 -07:00
Patrice Chalin 376bdf4dc7 fix(bootstrap): report error on bootstrapping non-Component directive
Fixes #951. Test case added to exercise new error reporting. Also added
extra test for when Template is missing.

Closes #961
2015-03-18 21:51:46 -07:00
Pawel Kozlowski a35cc27781 fix(PropertyBindingParser): properly parse event bindings as actions
Fixes #981

Closes #987
2015-03-18 19:09:59 +01:00
Tim Blasi d10df7de44 style(dart/transform): Rename .ngDeps.dart => .ng_deps.dart
Update to conform with file naming conventions.

Closes #975
2015-03-17 22:12:08 -07:00
Pawel Kozlowski 59a1f836a2 fix: allow creation of var with camelCased names
Closes #957
2015-03-17 21:39:26 -07:00
vsavkin 99f2d7faf6 removed circular deps so tests run on node 2015-03-17 16:31:37 -07:00
vsavkin 2041860a21 feat: added an ability to dynamically load components 2015-03-17 15:23:59 -07:00
vsavkin 7488456d68 feat(element_injector): added PrivateComponentLocation 2015-03-17 15:23:58 -07:00
vsavkin b69f3043e0 feat(compiler): added the DynamicComponent annotation 2015-03-17 15:23:58 -07:00
vsavkin a16954d3a5 refactor(view): separate context and locals 2015-03-17 14:25:57 -07:00
Yegor Jbanov 70c875ee14 refactor(shadow dom): do not use injectors nor directives
This prepares us for the app/render split in the compiler.
2015-03-16 16:58:38 -07:00
vsavkin 75ecaf02b9 chore: upgrade guinness to remove a workaround in testlib 2015-03-13 18:19:10 -07:00
vsavkin 33bff17f33 refactor(tests): refactor tests to clarify the behavior of onChange 2015-03-13 18:09:31 -07:00
vsavkin 3273adade5 refactor(view): change view to pass all bindings to proto change detector at once 2015-03-13 14:03:57 -07:00
Pawel Kozlowski b39d2c0101 fix: properly bind to camelCased properties
Fixes #866
Closes #941
2015-03-13 19:50:47 +01:00
Marc Laval e8965656a4 feat(directives/forms): run tests in NodeJS
Closes #921
2015-03-13 19:18:15 +01:00
Victor Berchet 7322ed721e refactor: remove reference to the FIELD class 2015-03-13 18:59:51 +01:00
Marc Laval 8d2ee6bbda feat(selector): add support for :not
Fixes #609
Closes #948
2015-03-13 18:26:10 +01:00
Tim Blasi 5c1c534894 test(dart/transform): Move BindGenerator tests to their own dir.
Move existing BindGenerator test to its own directory and to test that
phase specificially, rather than the whole pipeline.
Add another BindGenerator test.
2015-03-13 10:25:11 -07:00
Tim Blasi 4b12c19560 feat(dart/transform): Add a parser for `.ng_deps.dart` files and use.
Use the parser in `BindGenerator`
This checkin also removes types from `registerSetters` calls since they
can cause runtime failures (see #886). We will resolve this by
generating change detector classes in the future.
2015-03-13 10:24:15 -07:00
Tim Blasi 92b22d24d0 feat(dart/transform): Add a `.ng_deps.dart` file parser.
Create a common, reusable `.ng_deps.dart` file parser. All future transformer
phases build on the information in `.ng_deps.dart` files.
2015-03-13 10:24:15 -07:00
Tim Blasi 95c9eca64c style(dart/transform): Change quote character for consistency.
Use ' as a quote character in generated output instead of ".
2015-03-13 10:24:15 -07:00
Victor Berchet 30253592ff refactor(tests): refactor some tests to use the test injector 2015-03-13 18:20:02 +01:00
Victor Berchet 33b5ba863e feat(tests): add a test injector
fixes #614

Asynchronous test should inject an AsyncTestCompleter:

Before:

  it("async test", (done) => {
    // ...
    done();
  });

After:

  it("async test", inject([AsyncTestCompleter], (async) => {
    // ...
    async.done();
  }));

Note: inject() is currently a function and the first parameter is the
array of DI tokens to inject as the test function parameters. This
construct is linked to Traceur limitations. The planned syntax is:

  it("async test", @Inject (async: AsyncTestCompleter) => {
    // ...
    async.done();
  });
2015-03-13 18:20:02 +01:00
Pawel Kozlowski 5926d2e2f7 refactor: use attributes for directives matching
Closes #940
2015-03-13 17:24:14 +01:00
Rado Kirov f7963e1ea6 fix(shadowdom): allow conditional content tags.
Distribution is triggered on the host element injector after each new
view creation.
2015-03-12 12:06:47 -07:00
Victor Berchet a82e20889d feat(Injector): Support binding to null 2015-03-12 19:52:08 +01:00
Victor Berchet 951a808e0e refactor(PropertySetter): use the global reflector 2015-03-12 19:49:34 +01:00
Marc Laval c67194a3ef fix(test_lib): remove getDistributedNodes emulation in NodeJS 2015-03-12 11:16:47 +01:00
Rado Kirov dd3e6271c2 chore(services): rename services.
Closes #711
2015-03-11 18:30:37 -07:00
Tim Blasi f4e0f51f5a feat(dart/transform) Register parameter metadata information
Adds any metadata attached to a parameter to the "parameters" value
passed in to `registerType`.

For example:
`MyComponent(@Inject(Foo) foo)` generates
`"parameters": const [const [const Inject(Foo)]]`

Also reorganizes the testing code.

Closes #7
2015-03-11 17:21:49 -07:00
Rado Kirov f1593ebca5 feat(shadowdom): turn on ShadowDom Emulated Mode by default.
Closes: #526
2015-03-11 12:46:15 -07:00
Marc Laval 1d4ff9bcdc feat(compiler): parse5 DOM adapter
Closes #841
2015-03-11 14:42:54 +01:00
Tim Blasi d0aceef4e0 perf(dart/transform) Restructure transform to independent phases
Update summary:
- Removes the need for resolution, gaining transform speed at the cost
  of some precision and ability to detect errors
- Generates type registrations in the package alongside their declarations
- Ensures that line numbers do not change in transformed user code
2015-03-10 19:19:02 -07:00
vsavkin 08bd3a4443 feat(forms): add form builder 2015-03-10 18:12:50 -07:00
vsavkin 10fb7bb05f refactor(forms): make form group responsible for supporting optional controls 2015-03-10 18:12:30 -07:00
Marc Laval 5acde20c7d refactor(compiler): remove direct accesses to DOM in tests
Closes #899
2015-03-10 22:08:27 +01:00
Victor Berchet 370643539f refactor(EventHandler): have a single instance of event handlers per ProtoView 2015-03-10 15:26:06 +01:00
Victor Berchet bfa18ffd9b feat(Directives): add the ability to declaratively bind events
relates to #621
2015-03-10 08:14:24 +01:00
Pawel Kozlowski 0d1dece7b4 feat: introduce Title service
Closes #612

Closes #900
2015-03-09 22:17:28 +01:00
Victor Berchet b349c35678 feat(ElementInjector): implement @PropertySetter
relates to #621
2015-03-09 18:28:39 +01:00
Victor Berchet c3873be295 fix(Compiler): asynchronous error reporting 2015-03-09 16:42:37 +01:00
Victor Berchet 03793d0714 feat(CssProcessor): add support for CssTransformers
Closes #860
2015-03-03 11:24:08 -08:00
Victor Berchet 9982520a23 refactor(Compiler): make shadow DOM stragegy support more flexible 2015-03-03 11:24:08 -08:00
vsavkin 733915d99b feat(forms): add support for nested forms 2015-03-02 14:53:03 -08:00
vsavkin ba0a1ec459 feat(di): add support for optional dependencies 2015-03-02 14:38:02 -08:00
Bertrand Laporte 3059104e8d add compilation error test for dart
Closes #812
2015-03-02 14:38:02 -08:00
vsavkin 21f24d19dd feat(change_detection): implement hydration/dehydration 2015-03-02 13:28:39 -08:00
Richard Harrington f30e3e59b5 fix(docs): fix typo in compiler integration_spec.js
Closes #834
2015-02-28 12:00:49 +01:00
Yegor Jbanov 757eae8ad3 feat(compiler): DOM adapters + html5lib implementation; misc fixes 2015-02-27 16:49:14 -08:00
Pawel Kozlowski 7e6f536cf5 fix(compiler): properly bind to properties that don't have matching attr name
Fixes #619
Closes #783
2015-02-27 16:10:16 +01:00
Victor Berchet 8541cfd26d feat(ShadowDomStrategy): implemented EmulatedUnscopedShadowDomStrategy
- The new strategy do not scope component styles but make them global,
- The former EmulatedShadowStrategy has been renamed to
EmulatedScopedShadowDomStrategy. It does scope the styles.
2015-02-26 20:00:23 +01:00
Victor Berchet 9f181f39e9 fix(StyleUrlResolver): add support for media query in import rules 2015-02-26 20:00:23 +01:00
Victor Berchet 4d8d17ce3d fix(StyleInliner): add support for url(url) format 2015-02-26 20:00:23 +01:00
Victor Berchet 06f7481141 feat(RegExp): expose match indexes in Dart 2015-02-26 19:32:49 +01:00
vsavkin cf9cb61665 clean(forms): cleanup 2015-02-26 09:35:30 -08:00
vsavkin f27e538e2c feat(forms): add optional controls 2015-02-26 09:31:02 -08:00
vsavkin a73c643322 feat(forms): remove support for declaring forms in html 2015-02-26 09:31:02 -08:00
vsavkin ded83e589b feat(forms): add support for validations 2015-02-26 09:31:01 -08:00
Victor Berchet 929fc65493 refactor(template loading): add support for base URLs, css rewriting
fixes #654
2015-02-26 09:36:04 +01:00
Victor Berchet 9250cd6a78 fix(ShimShadowCss): preserve attribute on style elements 2015-02-26 09:04:00 +01:00
Victor Berchet edb797e191 feat(StyleUrlResolver): rewrite url in styles 2015-02-26 09:04:00 +01:00
Victor Berchet ff406e65dc feat(UrlResolver): combine a base URL with an URL 2015-02-26 09:04:00 +01:00
Victor Berchet e0cf1c7ab5 feat(StyleInliner): StyleInliner inlines @import css rules 2015-02-26 09:04:00 +01:00
Victor Berchet 41c61e5bc7 refactor(Completer): rename complete() to resolve() 2015-02-26 08:46:32 +01:00
Rado Kirov 6ad2c18277 feat(events): adds support for bubbling native events (^event).
Refactor - move DomEventManager into its own plugin.
2015-02-25 19:08:16 -08:00
Rado Kirov 2f015cc336 fix(view_container): fixes injection on dynamically added views.
Closes #777
2015-02-25 18:05:57 -08:00
vsavkin 6b2650996c fix(parser): parse pipes in template bindings 2015-02-25 14:39:44 -08:00
Pawel Kozlowski 4a5d53c549 feat: allow using KeyValueChanges as a pipe 2015-02-25 13:24:59 -08:00
Tim Blasi 50a74b1d91 feat(dart/transform): Generate setter stubs.
Generate calls to Reflector#registerSetters from the information in
provided `Directive#bind` values.

This is only an initial attempt - it covers only the most basic values
of `bind`.

Closes #780
2015-02-25 09:54:13 -08:00
Bertrand Laporte 94e203b9df feat(DirectiveParser): throw errors when expected directives are not present
closes #527
Closes #570
2015-02-24 20:57:21 -08:00
Pawel Kozlowski 908a0aa7dc test: introduce TemplateResolver mock
Closes #768
2015-02-24 10:34:52 -08:00
Tim Blasi 3b6aaf9054 feat(dart/transform) Remove import of dart:mirrors
+ Precede the call to `new ReflectionCapabilities()` with our generated
code which populates the reflection map statically.
+ Add the import of our generated code.
+ Once we are generating all necessary code, we will remove the
import of reflection_capabilities.dart and the instantiation of
`ReflectionCapabilities`, cutting the dependency on dart:mirrors.

Closes #761
2015-02-23 18:36:29 -08:00
Yegor Jbanov d1f03e509b fix(benchpress): benchpress fixes and a smoke test for Dart 2015-02-23 10:50:51 -08:00
Tim Blasi fb49946160 feat(dart/transform) Allow ctor stubs to be tree shaken
Change the method used to discover Directive annotated classes to ensure
that the Dart code can be tree shaken.

Closes #497

Closes $\x23736
2015-02-21 18:20:05 +00:00
Pawel Kozlowski 0c4fbfc8e2 feat(di): introduce aliasing
Closes #710
Closes #747
2015-02-21 18:43:45 +01:00
vsavkin 0dfd287ec3 fix(change_detection): handle locals when invoking a method
Closes #660
2015-02-20 17:55:06 -08:00
vsavkin 7f31036427 fix(change_detection): pass the correct previous value when using pipes
Closes #588
2015-02-20 17:53:57 -08:00
vsavkin 987a5fdf56 feat(change_detection): add support for pipes in the template 2015-02-20 17:16:57 -08:00
vsavkin 29f5ee0c29 fix(shadow_dom_emulation): handle the case when the array of element injectors has nulls 2015-02-20 15:52:15 -08:00
vsavkin 58ba700b14 feat(change_detection): change binding syntax to explicitly specify pipes 2015-02-20 10:59:46 -08:00
Victor Berchet 69e02ee76f feat(ViewSplitter): Change template shorthand syntax from '!' to '*'
fixes #717

Closes #727
2015-02-20 10:36:30 -08:00
Tim Blasi 329b2eda66 refactor(dart/transform tests): Use actual directive def'n instead of mock.
In the transformer unit tests, we previously used a mock directive annotation. This update
substitutes the actual Angular2 directive annotations.

Closes #706
2015-02-20 09:44:56 -08:00
Victor Berchet d0ca07afaa refactor(Compiler): introduce ShimComponent to shim CSS & DOM in emulated mode
Closes #715
2015-02-19 13:42:18 -08:00
Victor Berchet 5111f9ae37 feat(ShadowCss): Make the shim also accept a selector for the host 2015-02-19 13:42:18 -08:00
Victor Berchet d67f0299cd feat(ShadowCss): port implementation from webcomponent.js 2015-02-19 13:42:18 -08:00
Marc Laval 3496c8ac54 refactor(change_detection): remove circular dependencies
Closes #712
2015-02-19 13:42:00 -08:00
Tim Blasi 4d56a1e1af chore: Fixing review comments on Dart transformers
See https://codereview.chromium.org/927373004/

Closes #705
2015-02-18 21:08:42 -08:00
Kevin Moore fb5b168b19 chore: Remove unused imports and enable checks for unused imports as part of build 2015-02-18 21:06:30 -08:00
Jeremy Elbourn 821f008462 chore(compiler): add integration tests for @Parent and @Ancestor 2015-02-18 17:20:47 -08:00
Jeremy Elbourn 785ec26322 feat(compiler): make directive bindings optional. Fixes #647 2015-02-18 13:56:14 -08:00
Pawel Kozlowski 56f4e84d45 fix: flip attr / property bind in directives annotations
Fixes #648

Closes #684
2015-02-18 17:07:53 +01:00
Pawel Kozlowski 709c3ca6b5 refactor: use the ExceptionHandler service
Fixes #533
Closes #672
2015-02-18 13:48:28 +01:00
vsavkin 695b4ebbc7 feat(change_detection): add support for pipes 2015-02-17 17:12:58 -08:00
Kevin Moore fa25965939 chore: Remove unused imports
Closes #624
2015-02-17 16:49:08 -08:00
Tim Blasi 6e90cacaf4 feat(dart/transformer:: Initial commit of ctor stubs & annotation register
Closes #646

Closes #496

Closes #498
2015-02-17 16:34:19 -08:00
Tobias Bosch e163eb2a51 fix(test_lib): support deep compare of objects with private/static fields 2015-02-17 16:02:46 -08:00
Pawel Kozlowski 92afad6ebc feat: support bindings for the 'role' attribute
Closes #630
2015-02-14 21:24:40 +01:00
Pawel Kozlowski 1846ce8c68 feat: support binding to aria-* attributes
Closes #643
2015-02-14 20:28:08 +01:00
Victor Berchet e6c8bde808 feat(Compiler): Multiple template per component
fixes #596

- TemplateConfig becomes Template
- introduce a TemplateResolver to pick the cmp template,
- @Component and @Template are disociated
2015-02-13 18:07:08 +01:00
Victor Berchet 6d23d00057 refactor(ViewPort): @Template -> @Viewport, ViewPort -> ViewContainer
fixes #595
2015-02-13 17:48:27 +01:00
Marc Laval 0499eeb231 refactor(facade): remove dependency to rtts_assert
Closes #593
2015-02-13 12:57:10 +01:00
Marc Laval 6d8ccaa8e4 feat(TemplateConfig): support array of arrays in TemplateConfig directives
Fixes #592
Closes #600
2015-02-12 11:56:45 +01:00
Victor Berchet 8844671c8d feat(EventManager): implement the EventManager 2015-02-12 10:46:11 +01:00
vsavkin 91fd5a69bf test(change_detection): add an integration test verifying that binding propagation config works 2015-02-11 17:54:07 -08:00
Victor Berchet fc1b791a7a fix(view): ViewPort light should come from the direct parent 2015-02-11 09:16:53 +01:00
Victor Berchet b953956a35 refactor(view_spec): Drop SomeComponentWithEmulatedShadowDom 2015-02-11 09:16:53 +01:00
Rado Kirov 6e923cbf84 fix(compiler): elements with events only create binders but not protoElementInjectors.
Closes #577
2015-02-10 15:29:34 -08:00