Commit Graph

207 Commits

Author SHA1 Message Date
Victor Berchet 4d338a4f5c test(ElementInjector): test that hostInjector has priority over viewInjector 2015-06-08 20:34:44 +02:00
Victor Berchet 6a6b43de07 feat(ElementInjector): throw if multiple directives define the same host injectable
relates to #2015
2015-06-08 20:34:44 +02:00
Victor Berchet 29c72abcc4 feat(Events): allow a different event vs field name
closes #2272
closes #2344
2015-06-08 19:29:49 +02:00
vsavkin 69b75b7fd8 feat(view): added support for exportAs, so any directive can be assigned to a variable 2015-06-04 14:14:03 -07:00
Rado Kirov 552985e305 fix(types): parametrize QueryList. 2015-06-03 17:08:55 -07:00
Martin Probst f999d5a156 chore: move to clang-format 1.0.17.
clang-format 1.0.17 substantially improves formatting for fat arrow functions
and array literal detection. It also fixes a number of minor formatting issues.
2015-06-03 15:27:27 -07:00
Tobias Bosch 5030ffb01c feat(view): introduce free embedded views
Free embedded views are view instances that are created
logically in the same was as views of a ViewContainer,
but their dom nodes are not attached.

BREAKING CHANGE:

- `Renderer.detachFreeHostView` was renamed to
  `Renderer.detachFreeView`
- `DomRenderer.getHostElement()` was generalized into
  `DomRenderer.getRootNodes()`
2015-06-03 14:42:00 -07:00
vsavkin d523613329 test(di): added a test verifying hierarchical injection 2015-05-29 15:52:46 -07:00
Tobias Bosch f9908cd436 feat(test): add element probe
Usage: bootstrap the app with the special binding
`ELEMENT_PROBE_CONFIG` from `angular2/debug`.
This will provide a global method `ngProbe(element)` that
will expose a `DebugElement` with directive instances, ... on it.

During tests that use Angular's test injector, the probe is
enabled by default. The `DebugElement ` can be retrieved via the
function `inspectDomElement` of `angular2/debug`. Note
that the `TestComponentBuilder` already returns `DebugElement `s.

Closes #1992
2015-05-29 12:44:21 -07:00
Tobias Bosch 75578f41e7 feat(view): add `AppViewListener` interface
Basic functionality how element probe is hooked into
the system.
2015-05-29 11:33:22 -07:00
Tim Blasi ffb219fb91 style(dart): Format Dart source with dart_style 0.1.8 2015-05-29 10:42:47 -07:00
Victor Berchet d7df853bde feat(Directive): convert properties to an array
fixes #2013

BREAKING CHANGE:

Before

    @Directive(properties: {
      'sameName': 'sameName',
      'directiveProp': 'elProp | pipe'
    })

After

    @Directive(properties: [
      'sameName',
      'directiveProp: elProp | pipe'
    ])
2015-05-29 11:44:43 +02:00
vsavkin c39c8ebcd0 feat(change_detection): added onInit and onCheck hooks 2015-05-28 16:46:22 -07:00
vsavkin 34cfc9f474 feat(di): added optional self parameter to Parent, Ancestor, and Unbounded 2015-05-28 09:53:06 -07:00
vsavkin 30b6542fc8 feat(core): added support for detecting lifecycle events based on interfaces 2015-05-27 16:23:42 -07:00
Marc Laval c6335c128e feat(test_lib): add method to compare stringified DOM element
Closes #2106
2015-05-27 16:19:39 +02:00
Tobias Bosch 79f564be46 refactor(core): ts’ify tests 2015-05-26 17:01:31 -07:00
yjbanov d48fae3566 fix(core): resurrect OnChange interface 2015-05-22 16:48:00 -07:00
Martin Probst 15f1eb28a2 fix(deps): Update clang-format to 1.0.14. 2015-05-22 09:39:15 -07:00
Victor Berchet b1c9bf14b2 feat(ElementInjector): support an arbitrary number of bindings
fixes #1853
2015-05-22 13:42:53 +02:00
Tobias Bosch cc2c8f6b00 refactor(test): ts’if compiler integration tests. 2015-05-21 17:53:53 -07:00
yjbanov c5996529c3 chore(expressions): add explicit test for map vs property access 2015-05-21 14:41:26 -07:00
vsavkin 705ee46f31 fix(di): changed host and view injector to respect visibility 2015-05-21 09:17:56 -07:00
vsavkin b6b52e62b2 fix(element_injector): fixed element injector to inject view dependencies into its components 2015-05-20 17:48:04 -07:00
vsavkin 28c2b8f432 fix(element_injector): fixed element injector to resolve dependencies of regular services 2015-05-20 10:56:33 -07:00
vsavkin 62b1a08f06 refactor(reflection): improved error message 2015-05-19 21:17:52 -07:00
Yegor Jbanov 8ab773538b fix(errors): require passing stack traces explicitly in ng2 own code 2015-05-19 12:48:00 -07:00
vsavkin b066b8d15a feat(di): added hostInjector and viewInjector to the Directive annotation 2015-05-18 18:30:53 -07:00
vsavkin 7b511462af refactor(core): renamed injectables into appInjector
BREAKING CHANGES

Before:

@Component({injectables: [Type]} class MyCmp{}

After:

@Component({appInjector: [Type]} class MyCmp{}
2015-05-18 18:30:52 -07:00
vsavkin 3a53f67911 feat(di): removed publishAs
BREAKING CHANGES

Removes the publishAs property from the Component annotation.
2015-05-18 18:30:52 -07:00
Jeremy Elbourn bb2eda2d15 feat(element_injector): allow @Optional for ProtoViewRef 2015-05-18 12:48:33 -07:00
Tim Blasi 3644036693 refactor(proto_view_factory): Move getChangeDetectorDefinitions out of ProtoViewFactory
Move `getChangeDetectorDefinitions` out of `ProtoViewFactory` since it
does not depend on any state in that object.
2015-05-18 08:45:59 -07:00
Yegor Jbanov b6f29b4448 feat(errors): preserve stack traces of user exceptions in Dart 2015-05-15 15:03:31 -07:00
Tobias Bosch 421d8916a6 refactor(view_manager): split `inPlace` views into root and free host views.
BREAKING CHANGE:
`AppViewManager.createInPlaceHostView` is replaced by
`AppViewManager.createRootHostView` (for bootstrap) and
`AppViewManager.createFreeHostView` (for imperative components).

The later creates new host elements that are not attached anywhere.
To attach them, use `DomRenderer.getHostElement(hostviewRef)`
to get the host element.

Closes #1920
2015-05-15 13:24:53 -07:00
Victor Berchet 25cd6e4321 fix(Compiler): add an error when a directive is null or undefined
fixes #1908
2015-05-15 19:26:06 +02:00
Tobias Bosch ecb068019b refactor(proto_view_factory): expose data for generating change detectors
Also consolidates metadata handling in `ElementInjector`

BREAKING CHANGE:
- renames `DirectiveMetadataReader` into `DirectiveResolver`
  and removes `src/core/compiler/directive_metadata`.

Fixes #1712
Fixes #1713
2015-05-13 17:11:59 -07:00
vsavkin 685a6507b6 feat(compiler): added support for [()] syntax 2015-05-13 16:08:59 -07:00
Victor Berchet c20060d259 fix(directives): fix import path 2015-05-13 11:56:50 +02:00
Misko Hevery 111fa60a93 chore: rename for to ng-for
Closes #1598
Closes #1295
Closes #1827

Closes #1827
2015-05-12 15:32:44 -07:00
Misko Hevery d310a9c0b4 chore: rename if to ng-if 2015-05-12 15:32:44 -07:00
yjbanov 358a6750ed feat(di): support type literals in DI 2015-05-12 10:57:53 -07:00
vsavkin 7f976381d5 fix(view): fixed ProtoViewFactory to get all property bindings 2015-05-11 17:38:34 -07:00
vsavkin f9c1de46b3 feat(compiler): added support for host actions 2015-05-11 13:28:19 -07:00
Tobias Bosch 4f3433b5bd feat(view): allow to transplant a view into a ViewContainer at another place.
Closes #1492.
2015-05-08 21:35:01 -07:00
yjbanov 1a0da11e55 feat(di): components can self-publish via publishAs 2015-05-08 16:13:00 -07:00
Tobias Bosch c68fa27444 refactor(render): remove recursion from renderer
The goal is to make implementing a renderer straight forward.

BREAKING_CHANGE:

- Renderer interface was redone / simplified.
- `DirectDomRenderer` was replaced by `DomRenderer`.
- `DirectDomRenderer.setImperativeComponentRootNodes` is replaced
  by the following 2 steps:
    1. `ViewManager.getComponentView(elementRef) -> ViewRef`
    2. `DomRenderer.setComponentViewRootNodes(viewRef, rootNodes)`
- all `@View` annotations need to have a template, but the template
  may be empty. Previously views that had a `renderer` property did
  not have to have a `template`.
- `dynamicComponentLoader.loadIntoNewLocation` does no more allow
  to pass an element, but requires a css selector.
  Special syntax: `:document` can be used as prefix to search globally
  on the document instead of in the provided parent view.

Part of #1675
2015-05-08 09:37:41 -07:00
Martin Probst 4ce0d5e024 fix(dart): Remove unused imports.
These imports cause dart analyze errors once ts2dart removes the
IMPLEMENTS import.
2015-05-08 15:24:37 +02:00
Pawel Kozlowski 51839ca677 feat(compiler): allow setting attributes on a host element
Closes #1402
2015-05-08 14:22:07 +02:00
vsavkin fa28b28d0a build(typescript): Migrated change detection to typescript 2015-05-07 17:18:04 -07:00
Rado Kirov be7504d451 fix(decorators): fixes decorator reflection.
The bug appears when there are only type annotations without parameter
annotations.
2015-05-06 13:44:44 -07:00