54 Commits

Author SHA1 Message Date
Marc Laval
52d88457c8 fix(NgRepeat): activate index 2015-01-29 13:29:32 -08:00
vsavkin
850cf0fef4 feat(change_detection): implement a change detector generator 2015-01-27 16:18:15 -08:00
Rado Kirov
fd34a56347 feat(events): adds support for injectable angular event emitters.
Event emitters can be injected into Directives. Event emitters take over
browser events with the same name. Emitted events do not bubble. Event
emitters can be injected even if there is no corresponding callback in
the template.

Use as follows:
@Decorator(...)
class MyDec(@EventEmitter('click') clickEmitter) {
 ...
 fireClick() {
  var eventData = {...};
  this._clickEmitter(eventData);
 }
}
2015-01-22 10:14:03 -08:00
vsavkin
9957c1338e feat(change_detection): reimplement change detection 2015-01-21 14:21:14 -08:00
Victor Berchet
03c21a8cb2 feat(events): add the $event local variable to the handler context 2015-01-21 10:03:21 +01:00
Rado Kirov
7f701da66f fix(events): extract eventHandler to new function scope. 2015-01-16 16:46:01 -08:00
Rado Kirov
2381c3640b fix(event): check hydration before firing event.
It is unlikely, but it can happen that an event is fired on a dehydrated
view. Extra guard asserts the events fire only on hydrated views.
2015-01-16 13:43:02 -08:00
vsavkin
fb1b1da7b9 feat(directive): notify directive before they get destroyed 2015-01-15 18:16:11 -08:00
vsavkin
ec8e9f5634 feat(emuldated_shadow_dom): implement intermediate content tags 2015-01-15 17:43:45 -08:00
Rado Kirov
c5b0baf805 feat(view): adds event binding to view instantiation.
Only native non-bubbling events are supported by the commit.
2015-01-13 21:12:52 -08:00
Misko Hevery
c0a99ee7b1 perf: remove field declarations from branches in constructors
This should help with hidden class detection.
2015-01-12 15:16:25 -08:00
Victor Berchet
41907853b4 refactor(view): code simplification 2015-01-09 19:09:54 +01:00
vsavkin
fbcc59dc67 feat(components): initial implementation of emulated content tag 2015-01-08 19:38:37 -08:00
Victor Berchet
457cbaa39b fix(ProtoView): element injector should have either a parent or a host
fix #359
2015-01-07 11:55:58 +01:00
Misko Hevery
0866485f95 perf: Traverse dom using firstChild instead of childNodes
5% improvement in speed by not using childNodes DOM API.
2015-01-06 13:16:57 -08:00
vsavkin
739f624cc8 refactor(change_detection): add change_detection library file 2014-12-29 15:20:42 -08:00
vsavkin
a37950293a cleanup(core): fix dart analyzer warnings 2014-12-29 12:12:11 -08:00
vsavkin
da9d041f90 feat(view): add support for components that use shadow dom emulation 2014-12-29 11:42:34 -08:00
Rado Kirov
60456c8b89 feat(ng-repeat): initial implementaion of ng-repeat.
- adds support for content bindings via '[]'.
- directives module
2014-12-11 11:23:02 -08:00
Tobias Bosch
3ec3d5e084 perf(view): inline and refactor view instantiation and hydration
- Don’t convert DOM array into JS array via `Array.slice`
- Inline static methods for instantiation and hydration
- Misc cleanup

Closes #291
2014-12-09 16:16:45 -08:00
Victor Berchet
ee36063fae style: misc minor changes 2014-12-08 21:59:59 +01:00
Victor Berchet
c362f33fe4 style(Change Detection): rename WatchGroupDispatcher to ChangeDispatcher 2014-12-08 21:59:59 +01:00
vsavkin
984ff9bf1b cleanup(view): remove unused code 2014-12-05 19:06:11 -08:00
vsavkin
33b47bd5d4 fix(view): fix DirectivePropertyGroupMemento to return a new group instead of null 2014-12-05 19:01:16 -08:00
Rado Kirov
174613067c feat(views): adds (de)hydration of views and template vars.
Dehydrated views are views that are structurally fixed, but their
directive instances and viewports are purged.

Support for local bindings is added to the view.
2014-12-04 22:40:51 -08:00
vsavkin
847cefcb7b feat(change_detector): notify directives on property changes 2014-12-03 14:33:52 -08:00
Rado Kirov
c6f14dd833 feat(viewPort): adds initial implementation of ViewPort.
ViewPort is the mechanism backing @Template directives. Those
directives can use the viewport to dynamically create, attach and
detach views.
2014-11-25 16:19:50 -08:00
vsavkin
6e8175a816 feat(Reflection): extract reflection capabilities into a separate module 2014-11-24 16:53:12 -08:00
Misko Hevery
044625a098 chore: Make field declarations explicit
This used to be valid code:

```
class Foo {
  constructor() {
    this.bar = ‘string’;
  }
}
```

This will now fail since ‘bar’ is not explicitly
defined as a field. We now have to write:

```
class Foo {
  bar:string; // << REQUIRED
  constructor() {
    this.bar = ‘string’;
  }
}
```
2014-11-24 16:35:39 -08:00
vsavkin
2980eb5b0b refactor(ChangeDetector): rename WatchGroup into RecordRange 2014-11-20 10:24:18 -08:00
Tobias Bosch
fc5b7edca4 feat(compiler): support on- and [] 2014-11-19 16:24:12 -08:00
Tobias Bosch
c6846f1163 feat(compiler): new semantics for template attributes and view variables.
- Supports `<div template=“…”>`, including parsing the expressions within
  the attribute.
- Supports `<template let-ng-repeat=“rows”>`
- Adds attribute interpolation (was missing previously)
2014-11-19 14:32:15 -08:00
Rado Kirov
1221857d17 feat(bootstraping): application bootstrapping implementation.
Entry-point to bootstrapping is a rootComponent. The bootstrapping
method, uses the component's selector to find the insertion element in
the DOM, and attaches the component in its ShadowRoot.
2014-11-18 15:02:38 -08:00
vsavkin
f0d6464856 feat(ChangeDetector): change View to construct a WatchGroup hierarchy 2014-11-17 17:49:17 -08:00
Rado Kirov
be4cb2db3a feat(view): add support for instantiation of nested component views.
Include shadowDom creation and integration tests for nested components.

Fix accidentally clobbered modules/core/test/compiler/view_spec.js by
previous commit.
2014-11-14 16:09:36 -08:00
vsavkin
d7208b8429 feat(ElementInjector): add NgElement 2014-11-14 13:22:39 -08:00
vsavkin
e15bcf0ffd refactor(ChangeDetector): pass formatters when instantiating a watch group 2014-11-14 13:16:55 -08:00
Tobias Bosch
1b79c91320 fix(compiler, view): centralize TemplateElement checks and fix inconsistencies
Fixes #189
Closes #194
2014-11-14 11:04:18 -08:00
Tobias Bosch
5e0ff2cbb7 refactor(ElementBinder): Store componentDirective and templateDirective as well. 2014-11-13 17:36:45 -08:00
Tobias Bosch
7308a3acc7 refactor(ElementInjector): support components
- Allow to access containing component directive instance from the shadow DOM.
- Allow to access app services of the app level injector of the component
  when the component is instantiated.
2014-11-13 17:32:52 -08:00
Tobias Bosch
7a70f8f92d feat(compiler): initial version of the compiler.
Supports:
- binds text nodes, element properties and directive properties
- locates decorator, component and template directives.
- inline templates of components

The compiler is built using a pipeline design,
see core/src/compiler/pipeline package.

Integration tests to show how the compiler, change_detection and DI work
together:
core/test/compiler/integration_spec.js
2014-11-11 17:55:50 -08:00
vsavkin
9448d78aa8 refactor(ProtoElementInjector): change instantiate to take positional args 2014-11-06 10:13:07 -08:00
vsavkin
b5f6417635 refactor(ElementInjector): use index instead of the elementInjector field to instantiate element injectors 2014-11-06 10:03:20 -08:00
Victor Berchet
0a766f4654 feat(Change Detection): Implement map changes 2014-11-05 14:02:03 -08:00
Rado Kirov
965fa1a985 feat(parser): adds basic expressions to the parser.
Mostly copy pasta from angular.dart.

Remove GetterFactory in favor for ClosureMap (which has basically the same
implementation).
2014-10-31 14:32:12 -07:00
Rado Kirov
8c566dcfb5 feat(elementBinder): introduce element binder.
It is a plain-old-data class to seperate the protoInjector from the
textNodes and elementBinding data.
2014-10-30 14:59:32 -07:00
Rado Kirov
91f50b67b7 feat(view): hook watch group instantiation in the view. 2014-10-29 17:04:56 -07:00
Rado Kirov
b0c9d05ea7 feat(view): add onChange implementation to view. 2014-10-29 13:32:20 -07:00
vsavkin
31831eee5e feat(View): implement ProtoView.instantiate 2014-10-27 17:18:35 -04:00
vsavkin
b71cd9f380 refactor(di): use boolean instead of bool 2014-10-12 17:15:58 -04:00