Commit Graph

1080 Commits

Author SHA1 Message Date
Yegor Jbanov c1a494bc37 chore(ShadowDomStrategy): remove redundant field styleInliner 2015-06-22 11:15:46 -07:00
Pawel Kozlowski d7b9345b6d feat(compiler): detect dangling property bindings
BREAKING CHANGE: compiler will throw on binding to non-existing properties.

Till now it was possible to have a binding to a non-existing property,
ex.: `<div [foo]="exp">`. From now on this is compilation error - any
property binding needs to have at least one associated property:
eaither on an HTML element or on any directive associated with a
given element (directives' properites need to be declared using the
`properties` field in the `@Directive` / `@Component` annotation).

Closes #2598
2015-06-20 08:06:07 +02:00
Victor Berchet 1c4d233fe7 fix(ShadowDomStrategy): always inline import rules
fixes #1694
2015-06-19 18:50:30 -07:00
Caitlin Potter ed9d9d5096 build(broccoli): make node_trees produce strict-mode scripts
Closes #2575
Closes #2648
2015-06-19 21:19:12 -04:00
Matias Niemelä 2d2ae9b8d8 feat(router): enforce usage of ... syntax for parent to child component routes 2015-06-19 20:54:45 -04:00
vsavkin 20a8f0dbe5 refactor(pipes): removed pipes from properties
BREAKING CHANGE:

This PR remove an ability to use pipes in the properties config. Instead, inject the pipe registry.
2015-06-19 16:56:52 -07:00
Pawel Kozlowski ad7aca631d refactor(NgClass): remove pipes from property bindings 2015-06-19 16:56:52 -07:00
vsavkin c899b0a74c feat(element_injector): support multiple injectables with the same token 2015-06-19 16:02:56 -07:00
vsavkin 5ba5da5d25 cleanup(forms): cleanup 2015-06-19 16:02:43 -07:00
vsavkin 4d1ed509e3 refactor(forms): refactored forms to user Query to get html validators 2015-06-19 16:02:43 -07:00
Martin Probst 920982c4e8 chore: update files to match clang-format 1.0.21. 2015-06-19 15:00:32 -07:00
Jacob MacDonald f9d72bd85b fix(transformer): Throw unimplemented errors in HtmlAdapter.
closes #2624
closes #2627
2015-06-19 14:45:58 -07:00
Ted Sander f2ef90b240 feat(transformers): inline styleUrls to view directive
While creating the ng_deps.dart file for a view inline the styleUrls attribute.
This copies the pattern used for templateUrl, aleviating the need to make an
XHR request for those resources.

closes #2566
2015-06-18 22:12:44 -07:00
vsavkin f80f97253c refactor(change_detection): made ChangeDetector and ProtoChangeDetector interfaces
List of changes:

- Makes ChangeDetector and ProtoChangeDetector interfaces
- Assigns a unique id to every detector
2015-06-18 17:41:22 -07:00
Tobias Bosch 9d4111d69d fix(compiler): make text interpolation more robust
Allows to add or remove previous siblings of text
interpolations (e.g. by added `<script>` tags for
content reproduction, or by removed `<style>` tags).

Also calculates correctly whether an element is
empty.

Fixes #2591
2015-06-18 15:45:00 -07:00
Tobias Bosch 180e617866 Revert "fix(Compiler): fix text nodes after content tags"
This reverts commit d599fd3434.
but keeps the integration test. The test is made green by the
following commits.
2015-06-18 15:45:00 -07:00
Brian Ford bc798b182d fix(router): return promise with error handler
See https://github.com/angular/angular/pull/2528\#discussion_r32493195
2015-06-18 14:57:33 -07:00
Martin Probst 941362014b feat: remove MapWrapper.clear().
It's the same in Dart and JavaScript.
2015-06-18 14:55:13 -07:00
Martin Probst dfd30910aa feat: remove MapWrapper.contains(). 2015-06-18 14:55:12 -07:00
Martin Probst be7ac9fd41 feat: remove MapWrapper.create()/get()/set().
Better dart2js code, better Angular code.
2015-06-18 14:55:12 -07:00
Yegor Jbanov 5beaf6d735 fix(change detection): preserve memoized results from pure functions 2015-06-17 17:33:37 -07:00
vsavkin b0e2ebda70 feat(query): added support for querying by var bindings 2015-06-17 16:36:55 -07:00
vsavkin cd21df3572 refactor(element_injector): renamed Query.directive into Query.selector 2015-06-17 16:25:41 -07:00
Martin Probst c7e48350d3 chore: kill ListWrapper.create() and .push().
These wrappers are not natively understood by
ts2dart. Removing them will improve Dart2JS
compilation due to fewer megamorphic calls to List
functions.

It also makes Angular code more succinct and
improves type safety in Angular due to better type
inference of the Array component type.

This change exposed several bugs in Angular.
2015-06-17 16:21:55 -07:00
Martin Probst 6af41a4543 chore: add missing `.d.ts` to type reference.
/// <reference> tags actually take a precise
path, it seems.
2015-06-17 16:21:55 -07:00
Victor Berchet dcc4bc2735 fix(annotations): swap DirectiveArgs & ComponentArgs 2015-06-17 21:59:53 +02:00
Tobias Bosch 5dee8e26cc fix(views): remove dynamic component views, free host views, free embedded views
Closes #2472
Closes #2339

BREAKING CHANGE
- `Compiler.compile` has been removed, the only way to compile
  components dynamically is via `Compiler.compileInHost`
- `DynamicComponentLoader.loadIntoExistingLocation` has changed:
  * renamed into `loadIntoLocation`
  * will always create the host element as well
  * requires an element with a variable inside of the host component view
    next to which it will load new component.
- `DynamicComponentLoader.loadNextToExistingLocation` was renamed into
  `DynamicComponentLoader.loadNextToLocation`
- `DynamicComponentLoader.loadIntoNewLocation` is removed
  * use `DynamicComponentLoader.loadNextToLocation` instead
    and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
- `AppViewManager.{create,destroy}Free{Host,Embedded}View` was removed
  * use `AppViewManager.createViewInContainer` and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
- `Renderer.detachFreeView` was removed. Use `DomRenderer.getRootNodes()`
  to get the root nodes of a view and detach them manually.
2015-06-17 11:33:51 -07:00
Pawel Kozlowski df6acedd25 refactor(RenderCompiler): minor changes to PropertyBindingParser
Closes #2583
2015-06-17 13:53:33 +02:00
Victor Berchet ffd1ac425e style(DI): idiomatic TS 2015-06-17 11:22:16 +02:00
Victor Berchet edd01615c3 refactor(Lexer): switch token types to an enum 2015-06-17 11:16:33 +02:00
Andreas Argelius 9700e80698 fix(docs): Fix docs for Directive.compileChildren 2015-06-17 09:14:44 +02:00
gdi2290 cd735c4837 fix(XHRImpl): file:/// and IE9 bugs 2015-06-17 09:14:26 +02:00
Misko Hevery b2c66949b2 feat: allow Type.annotations = Component(...).View(...)
Closes #2577
2015-06-16 16:36:46 -07:00
Misko Hevery eb3586d777 fix: makes NgModel work in strict mode 2015-06-16 16:36:46 -07:00
Jeff Cross 5b5ffe75d0 docs(Http): add docs for Http lib
Fixes #2442
2015-06-16 15:42:18 -07:00
Jeff Cross e68e69e7e5 refactor(Http): rename request options interface 2015-06-16 15:42:01 -07:00
Jeff Cross 70ffd267f8 refactor(Http): implement Request object parameter for http.request
Fixes #2416
2015-06-16 15:42:01 -07:00
Jeff Cross b68e561c0f feat(Http): add Http class
Fixes #2530
2015-06-16 15:42:01 -07:00
Jeff Cross 93596dff3f feat(BaseRequestOptions): add merge method to make copies of options 2015-06-16 15:42:01 -07:00
Victor Berchet 598a75ec1c style(ChangeDetection): idiomatic TS 2015-06-16 19:45:00 +02:00
Victor Berchet cdfb635737 refactor(facade): refactor type check function - is*() 2015-06-16 19:27:34 +02:00
Pawel Kozlowski 2d499de2bd refactor(view): remove unused const
Closes #2561
2015-06-16 17:56:21 +02:00
Victor Berchet d599fd3434 fix(Compiler): fix text nodes after content tags
fixes #2095
2015-06-16 17:38:42 +02:00
vsavkin d8e2795368 fix(view): local variables override local variables set by ng-for 2015-06-16 07:48:26 -07:00
Misko Hevery bc9e482b39 fix: Class factory now adds annotations 2015-06-15 22:23:54 -07:00
Brian Ford cab1d0ef0f feat(router): allow configuring app base href via token 2015-06-15 18:04:09 -07:00
vsavkin f1541e65b3 fix(forms): fixed the handling of the select element 2015-06-15 13:16:41 -07:00
Tobias Bosch 9bad70be5e fix(selector): select by attribute independent of value and order
Closes #2513
2015-06-15 12:10:11 -07:00
vsavkin 5bfcca2d5b feat(query): notify on changes 2015-06-15 11:10:21 -07:00
Matias Niemelä 73d152506b fix(router): ensure that root URL redirect doesn't redirect non-root URLs
Closes #2221
2015-06-15 10:48:47 -07:00
Matias Niemelä 3154cea0bf docs(router): `alias` should be `as` 2015-06-15 10:48:29 -07:00
Victor Berchet ac3e624d0f feat(View): add support for styleUrls and styles
fixes #2382
2015-06-15 19:35:16 +02:00
Victor Berchet f065a2ecb7 style(ShadowDomStrategy): remove an extra semi-colon 2015-06-15 19:35:16 +02:00
Victor Berchet a46df6f829 refactor(StringWrapper): add missing types 2015-06-15 19:35:16 +02:00
Victor Berchet da60381c89 feat(AstTranformer): add support for missing nodes 2015-06-15 18:54:12 +02:00
Victor Berchet 7d32879929 feat(Parser): support if statements in actions
fixes #2022
2015-06-15 18:54:12 +02:00
Victor Berchet d64cc8d87d style(render): idiomatic TS 2015-06-15 18:53:47 +02:00
Victor Berchet cebf69933c style(compiler): idiomatic TS 2015-06-15 18:53:47 +02:00
Misko Hevery c3ae34f066 feat: support decorator chaining and class creation in ES5
Closes #2534
2015-06-14 16:54:08 -07:00
Peter Bacon Darwin 4f581671dc style(change_detection): fix clang error: line too long 2015-06-15 00:44:20 +01:00
Peter Bacon Darwin 5a542d8ba8 docs(change_detection): fix link to `PreGeneratedChangeDetection` 2015-06-15 00:16:10 +01:00
Jeff Cross dd23bab3ad fix(docs): update link paths in annotations
Partial fix to #2452
Closes #2475
2015-06-15 00:11:59 +01:00
vsavkin 9908def857 fix(bootstrap): temporary disable jit change detection because of a bug in handling pure functions 2015-06-13 16:06:22 -07:00
Brian Ford 5782f063f1 fix(router): rethrow exceptions
Closes #2391
2015-06-12 18:27:00 -07:00
Martin Probst c3c2ad1454 fix: improve type of TreeNode.children. 2015-06-12 18:02:07 -07:00
vsavkin c51aef9f7d fix(element_injector): changed visibility rules to expose hostInjector of the component to its shadow dom 2015-06-12 17:17:31 -07:00
Tim Blasi e0fbd4b624 fix(change detect): Fix bug in JIT change detectors
Fix the "ifChangedGuard" code in the JIT change detector which was
incorrectly refactored in a2770c8a52.
2015-06-12 16:32:21 -07:00
Tim Blasi 8e3bf3907a feat(dart/transform): Use the best available Change Detectors
Enable pregenerated (for Dart) and JIT (for Js) change detectors when
possible. Previously we would always use `DynamicChangeDetector`s, but
these cause megamorphic calls and are therefore much slower.

Closes #502
2015-06-12 16:04:09 -07:00
vsavkin 21dcfc89e9 fix(dynamic_component_loader): implemented dispose for dynamically-loaded components 2015-06-12 15:47:09 -07:00
Martin Probst f3d741854a fix: add types for ts2dart's façade handling.
... in many, many places.
2015-06-12 15:41:08 -07:00
Martin Probst c4ecbf0a7f fix: rename FORWARD_REF to forwardRef in the Angular code base.
Now that ts2dart understands forwardRef, there's
no need to maintain the old syntax.
2015-06-12 15:41:08 -07:00
Matias Niemelä cdc7b03e67 fix(router): avoid two slash values between the baseHref and the path 2015-06-12 15:23:29 -07:00
Matias Niemelä e372cc779d fix(router): do not prepend the root URL with a starting slash 2015-06-12 15:23:29 -07:00
Victor Berchet b4e82b8bc7 fix(DirectiveMetadata): add support for events, changeDetection 2015-06-12 19:05:51 +02:00
Victor Berchet db3d5d4941 refactor(_DirectiveMetadataVisitor): simplify the code
fixes #2493
2015-06-12 19:05:51 +02:00
Martin Probst a6e7123995 feat: adjust formatting for clang-format v1.0.19. 2015-06-12 09:51:57 -07:00
Victor Berchet 7648bb8ee3 doc(Lifecycle events): Document the call order 2015-06-12 18:51:04 +02:00
vsavkin 35197acc1a fix(forms): fixed the selector of NgRequiredValidator 2015-06-12 09:45:56 -07:00
vsavkin 6622826587 docs(forms): updated forms docs to cover new apis 2015-06-12 09:45:55 -07:00
vsavkin 4fe919335c refactor(forms): made directive names consistent 2015-06-12 09:45:55 -07:00
vsavkin a858f6ac42 fix(forms): getError does not work without path 2015-06-12 09:45:55 -07:00
Rado Kirov 355ab5b3a6 feat(query): adds support for descendants and more list apis.
Additional clean up of query code.

Closes: #1935

BREAKING CHANGE:
By default Query only queries direct children.
2015-06-11 16:05:06 -07:00
Tobias Bosch ca09701343 perf(render): only create `LightDom` instances if the element has children 2015-06-11 14:45:44 -07:00
Tobias Bosch 4f27611ae6 perf(render): don't create property setters if not needed 2015-06-11 14:45:44 -07:00
Tobias Bosch 24e647e0f7 perf(render): precompute # bound text nodes and root nodes in `DomProtoView` 2015-06-11 14:45:44 -07:00
Tobias Bosch 9cd510abaa perf(render): don’t create an intermediate element array in renderer 2015-06-11 14:45:43 -07:00
Misko Hevery 5ab92ce844 bug: increase number of supported contstructor args to 20
Closes #2487
2015-06-11 14:02:36 -07:00
Victor Berchet 591f742d42 feat(transform): update for Directive.host 2015-06-11 13:11:10 -07:00
Victor Berchet 20953ed492 doc(Directive): update docs for Directive.host 2015-06-11 13:11:09 -07:00
Victor Berchet f3b49378e4 feat(Directive): Have a single Directive.host which mimics HTML
fixes #2268

BREAKING CHANGE:

Before

    @Directive({
      hostListeners: {'event': 'statement'},
      hostProperties: {'expression': 'hostProp'},
      hostAttributes: {'attr': 'value'},
      hostActions: {'action': 'statement'}
    })

After

    @Directive({
      host: {
        '(event)': 'statement',
        '[hostProp]': 'expression'  // k & v swapped
        'attr': 'value',
        '@action': 'statement'
      }
    })
2015-06-11 13:11:09 -07:00
Victor Berchet 47b6b05017 doc(Directive): fix the inline doc for lifecycle events 2015-06-11 13:11:09 -07:00
Victor Berchet f9745327e6 fix(Parser): Parse pipes in arguments
fixes #1680
2015-06-11 21:02:40 +02:00
Tim Blasi a187c782aa feat(dart/transform): Allow absolute urls in templates
Allow `templateUrl` to be specified as an absolute `package:` import.
2015-06-11 09:35:17 -07:00
Tim Blasi 950f2a38cd refactor(dart/transform): Rename parser.dart > ng_deps.dart
- Rename the file that defines NgDeps from parser.dart to ng_deps.dart.
- Remove the `Parser` class and replace with the static `NgDeps.parse`
  method.
2015-06-11 08:42:34 -07:00
Victor Berchet f2371487a1 refactor(ProtoRecord): switch to enum 2015-06-11 17:11:34 +02:00
Victor Berchet 6ca81fb98c refactor(ProtoViewDto): switch to enum 2015-06-11 17:11:34 +02:00
vsavkin af35ab56a3 fix(life_cycle): throw when recursively reentering LifeCycle.tick 2015-06-11 07:43:14 -07:00
vsavkin 15dab7c5b2 fix(ng_zone): updated zone not to run onTurnDown when invoking run synchronously from onTurnDone 2015-06-11 07:43:13 -07:00
Misko Hevery 2ccc65d7fd fix: Improve error message on missing dependency 2015-06-10 16:40:38 -07:00
Misko Hevery 7501ad11ca chore: Define ReflectionCapabilities interface 2015-06-10 16:40:38 -07:00
Victor Berchet 331a051e75 feat(Parser): implement Unparser
fixes #1949
closes #2395
2015-06-10 16:24:59 -07:00
gdi2290 92f1af86d8 perf(RouterLink): use hostListeners for click
with a `<router-outlet>` and lots of `router-link` you start to see
noticeable lag since we’re not removing the listener

Closes #2401
2015-06-10 16:20:58 -07:00
Victor Berchet 94272af45b chore: update zone.js to 0.5.1
fix #1862
2015-06-10 23:41:45 +02:00
Tim Blasi 17c6d6a92d feat(dart/transform): Add onInit and onCheck hooks in Dart
Implement `onInit` and `onCheck` hooks in pre-generated Dart change
detectors. This mirrors the changes made to the JIT change detector in
c39c8ebcd0.
2015-06-10 14:11:42 -07:00
Kevin Moore 633cf63682 fix: compare strings with StringWrapper.equals
Fixes https://github.com/angular/angular/issues/2458
2015-06-10 23:02:48 +02:00
Rado Kirov 92d565848b fix(shadow_dom): moves the imported nodes into the correct location. 2015-06-10 13:50:12 -07:00
Tim Blasi ddd5a235c3 test(change detect): Port change detect tests for mode
More the change detect tests that exercise various detection modes to
use the Dart pre-generated change detectors in addition to the `dynamic`
and `JIT` change detectors.

See #502
2015-06-09 17:04:50 -07:00
Peter Bacon Darwin 2cc2196140 docs(annotations_impl): fix invalid code blocks 2015-06-09 23:11:08 +01:00
vsavkin 902759e1c7 fix(analzyer): removed unused imports 2015-06-09 12:35:47 -07:00
vsavkin c564475251 example(forms): removed old forms example 2015-06-09 11:51:17 -07:00
vsavkin 3eff7be9a6 examples(forms): added an example of using template-driven forms 2015-06-09 11:51:15 -07:00
vsavkin e7e82cbee6 feat(forms): set exportAs to form for all form related directives 2015-06-09 11:51:15 -07:00
vsavkin 73bce40287 feat(forms): export validator directives as part of formDirectives 2015-06-09 11:51:14 -07:00
vsavkin 5fc23caef7 feat(forms): changed forms to capture submit events and fires synthetic ng-submit events 2015-06-09 11:51:13 -07:00
vsavkin 1a4d23742b feat(forms): added hasError and getError methods to all controls 2015-06-09 11:51:08 -07:00
Jeff Cross f34f8df319 refactor(xhr): move render's xhr implementation to render/
The existence of this module in the services/ folder led some to believe xhr
is meant to be a general-purpose http library.

Fixes #2305
2015-06-09 10:28:35 -07:00
Jeff Cross 21568106b1 feat(http): add basic http service
This implementation only works in JavaScript, while the Observable transpilation
story gets worked out. Right now, the service just makes a simple request,
and returns an Observable of Response.

Additional functionality will be captured in separate issues.

Fixes #2028
2015-06-09 10:00:04 -07:00
Rado Kirov 83e99fc72d fix(bundle): makes interfaces.ts non-empty when transpiled.
System.js seems detect an empty file as global and choke on exporting
symbols from angular2/angular2 (possibly a bug in system.js).

As temporary measure we make sure that the file has some (fake) runtime
code left.

Closes: #2343
2015-06-08 17:52:25 -07:00
gdi2290 e77710a372 fix(JsonPipe): always transform to json
BREAKING CHANGE:

no longer cache ref
2015-06-08 16:22:04 -07:00
Tim Blasi b6e95bb96e feat(change detect): Throw on attempts to use dehydrated detector
- Modify change detectors to `throw` when attempting to detect changes
  on a dehydrated detector.
- Modify `DynamicChagneDetector` to use `null` for the `context` of a
  dehydrated detector.
2015-06-08 16:10:41 -07:00
Brian Ford cd95e078fe feat(router): add routing to async components
Note that this also removes the `components` option from `RouteConfig`.
This functionality will be reintroduced with the more general `//` routing.
See #2329 for more details.
2015-06-08 15:49:56 -07:00
Brian Ford 548f3dd5cc feat(facade): add isMap method 2015-06-08 15:49:56 -07: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
Victor Berchet 79f3f3b456 refactor(Lexer): refactor scanComplexOperator() 2015-06-08 14:46:55 +02:00
Tim Blasi d1b35f9174 fix(dart/transform): Don't set ReflectionCapabilities over an async gap
Update the transformer's `TemplateCompiler` phase to avoid setting
`reflector.reflectionCapabilities`, allowing asynchronous
operations, and restoring the original value, which allows
`reflector.reflectionCapabilities` to get into a bad state.
2015-06-06 17:10:06 -07:00
Misko Hevery a418397174 fix: corrected var/# parsing in template
Closes #2084
2015-06-05 16:22:41 -07:00
Misko Hevery 8d081ea7af fix: include error message in the stack trace 2015-06-05 16:22:41 -07:00
Tobias Bosch 8a52375fb8 chore(transformer): add tests for property bindings and multiple executions 2015-06-05 13:11:24 -07:00
Tobias Bosch 87b3b718e3 refactor(render): don’t use a global cache for property setters
Related to #2359
2015-06-05 13:11:23 -07:00
Tim Blasi 529805508a feat(dart/change_detect): Add type to ChangeDetector context
Add a type for the `context` field in Dart's pre-generated change
detectors. This requires slight changes to set the dehydrated value of
`context` to `null` rather than `ChangeDetectionUtil.uninitialized()`,
which was its former dehydrated state.

Mirror these chagnes as closely as possible in the
`ChangeDetectionJITGenerator` to allow easier maintenance.

Closes #2070
2015-06-05 12:53:25 -07:00
Tim Blasi 851797aecb refactor(dart): Run dartfmt 0.1.8
Format Dart code using dartfmt 0.1.8. Update pubspec to require
dart_style 0.1.8.
2015-06-05 11:45:36 -07:00
Tim Blasi dc6e7eb19b feat(dart/transform): Record Type interfaces
To support interface-based lifecycle methods (#2220), we need to be able
to query for the `interface`s a class supports. Record implemented
interfaces to allow mirror-less querying at runtime.

Closes #2204
2015-06-04 15:02:12 -07:00
vsavkin e5419febe4 feat(transformers): updated transformers 2015-06-04 14:14:03 -07: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
vsavkin 4eb8c9b2dd fix(locals): improved an error message 2015-06-04 14:14:02 -07:00
Tobias Bosch 827841ec5b refactor(render): add `DomElement`
Replaces the multiple arrays of `DomView`
by a single array with `DomElement`s.

Note: this commit does not show a performance regression
(tested against the tree benchmark locally).
2015-06-04 11:44:26 -07:00
Victor Berchet 53694eb64a feat(FakeAsync): check pending timers at the end of fakeAsync in Dart
Made possible with quiver 0.21.4
2015-06-04 09:09:18 +02:00
Victor Berchet 31a3a19dac doc(Visibility): fix inline docs 2015-06-04 09:09:11 +02: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
vsavkin 3baf815d76 feat(forms): added support for status classes 2015-06-03 14:43:46 -07:00
vsavkin 96cadcc29e refactor(forms): handle dirty/pristine explicitly 2015-06-03 14:43:46 -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
Tim Blasi 83f1856d6a feat(dart/transform): Add support for the safe navigation operator
Adds support for ?. to pregenerated Dart Change Detectors.

Closes #791
2015-06-03 10:37:34 -07:00
Victor Berchet c7572ac1f9 feat(fakeAsync): flush the microtasks before returning
fixes #2269
2015-06-03 06:48:08 +02:00
vsavkin ec3a78289f feat(forms): added touched and untouched to Control 2015-06-02 17:32:41 -07:00
vsavkin f543834be9 feat(forms): renamed control, control-group into ng-control and ng-control-group 2015-06-02 16:24:08 -07:00
vsavkin 6bef1c4169 feat(forms): changed the selector of TemplatdrivenFormDirective to match <form> 2015-06-02 16:24:08 -07:00
vsavkin 652ed0cf6d feat(form): implemented an imperative way of updating the view by updating the value of a control 2015-06-02 16:24:07 -07:00
vsavkin 559f54e92b feat(forms): added ng-model 2015-06-02 16:24:07 -07:00
Jacob MacDonald 17e1d7f117 fix(dartdocs): Hide duplicate exports from guinness.
Duplicate exports were breaking dartdoc builds.

Closes https://github.com/angular/angular/issues/2072.
2015-06-02 16:01:46 -07:00
Tobias Bosch ba7956f521 fix(render): only look for content tags in views that might have them.
Largetable benchmark with `interpolationAttr` and 200 rows / 20 columns:
Time for destroy/create pair dropped from about 1260ms to about 150ms.

Related to #2298, but does not really fix it as we are still slow
if people are using `<content>`.

Closes #2297
2015-06-02 15:31:07 -07:00
Naomi Black c2fa4b7191 docs(chore): missing reformats to make clang-format 1.0.15 2015-06-02 15:30:04 -07:00
Naomi Black d32f58926d docs(ng-if): fix some missed occurrences of if, for, switch in docs 2015-06-02 15:30:04 -07:00
Naomi Black 6a0fe93ba9 chore(docs): fix another link broken by clang-format 2015-06-02 15:30:03 -07:00
Naomi Black dc060e8b64 docs(clang): format updates 2015-06-02 15:30:03 -07:00
Naomi Black b746e0c9f0 docs(docgen): tell dgeni to use ts files and fix some bad links 2015-06-02 15:30:03 -07:00
Ian Riley 1d24e2cf23 fix(Global && src/facade && Protractor): Allows List to be imported.
Allows the List type to be imported from 'angular2/src/facade/collection'
2015-06-02 13:11:31 -07:00
Ian Riley 9e36539052 fix(src/reflection && src/test_lib): Fixes bugs that caused benchmarks to fail.
Adjusts src/test_lib files to adhere to common TS module practices. Fixes bug with all files that causes benchmarks to fail.
2015-06-02 13:11:30 -07:00
Ian Riley 0602f68ae3 refactor (angular2/test_lib): ts'ifying last of test_lib
Translates last .es6 files in angular2/src/test_lib to TypeScript.
2015-06-02 13:11:30 -07:00
Jeff Cross ba07f39347 refactor(router): convert to typescript
Fixes #2001
2015-06-02 11:06:44 -07:00
Victor Berchet c60091b949 refactor(Compiler): improve the error message on component load error
by adding the fetched url.

relates to #1460
2015-06-02 12:59:50 +02:00
Victor Berchet 8811337622 refactor(ElementInjector): add interfaces for strategies 2015-06-02 10:09:39 +02:00
Victor Berchet 921fb9f2ce refactor(Injector): use TS iodioms 2015-06-02 09:53:11 +02:00
Victor Berchet e93b5a1d5b refactor(Injector): add an interface for strategies 2015-06-02 09:53:11 +02:00
gdi2290 db7a1f19ba feat(render/dom_renderer): DocumentToken use OpaqueToken
BREAKING CHANGE:

No longer a `const` string. Now a const OpaqueToken
2015-06-01 16:24:36 -07:00
gdi2290 ef27919f7f feat(core/compiler): AppViewPool use OpaqueToken
BREAKING CHANGE:

No longer a `const` string. Now a const OpaqueToken
2015-06-01 16:24:36 -07:00
gdi2290 c571b2693e feat(OpaqueToken): now a const constructor
BREAKING CHANGE:

now a `const` constructor
2015-06-01 16:24:36 -07:00
Tobias Bosch 62a95823e0 fix(selector): support multiple `:not` clauses
Fixes #2243
2015-06-01 14:24:19 -07:00
Tim Blasi 22f5925202 fix(facade): Make PromiseWrapper#all semantics equivalent
The semantics between ES6 `Promise#all` and Dart's `Future#wait` are
different for values that are not `Promise`/`Future`s. In ES6,
non-`Promise` values are immediately completed to their current value.
In Dart, non-`Future` values cause an error.

Updated Dart's `PromiseWrapper#all` implementation to conform to the ES6
spec.
2015-06-01 07:26:46 -07:00
vsavkin a9d6fd9afa feat(forms): implemented template-driven forms 2015-05-30 11:56:00 -07:00
vsavkin 5c53cf6486 fix(fake_async): fixed fakeAsync to throw instead of crashing on cjs 2015-05-30 11:55:17 -07:00
vsavkin 74882c6c38 feat(test): added not.toBeNull 2015-05-30 11:54:10 -07:00
uber5001 6404dd8293 refactor (angular2/src/dom): tsifying angular2/src/dom
translates parse5_adapter.cjs to typescript

Closes #2230
2015-05-29 17:01:05 -07:00
vsavkin f19970a481 feat(transformers): added support for lifecycle events 2015-05-29 16:40:34 -07:00
vsavkin d523613329 test(di): added a test verifying hierarchical injection 2015-05-29 15:52:46 -07:00
Tim Blasi 8a3b0b366f feat(dart/transform): Generate ChangeDetector classes
Use the `ProtoViewDto` created by the render `Compiler` to create a
`ChangeDetectorDefinition`.

From there, generate a subclass of `AbstractChangeDetector` for each
`ChangeDetectorDefinition`.

Run some basic unit tests for the dynamic and JIT change detectors on
pre-generated change detectors.
2015-05-29 14:48:53 -07:00
Jeff Cross e323c07ab9 refactor(benchpress): convert src and test to typescript
Fixes #2007
2015-05-29 14:02:58 -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 24bc4b66d0 fix(render): don’t store a document fragment as bound element
When a template contains bound text nodes as root nodes,
we used to store the document fragment that we got from
cloning `template.content`. However, this fragment will be
empty as soon as the view gets attached. Now we store
`null` instead of the document fragment in this case.

Also groups the 3 cases in `_createView` so they are easier to
understand.
2015-05-29 11:33:23 -07:00
Tobias Bosch 2351896cc0 fix(dom): allow to correctly clone document fragments 2015-05-29 11:33:23 -07:00
Tobias Bosch 307011a96c fix(dom): `querySelectorAll` should only query child nodes 2015-05-29 11:33:22 -07:00
Tobias Bosch 6f3368ef16 feat(dom): add `setData()` method. 2015-05-29 11:33:22 -07:00
Tobias Bosch cdf791f0c5 feat(facade): add read/write access to global variables 2015-05-29 11:33:22 -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
elimach a80921b45d fix(binding): unbalanced curly brackets in documentation 2015-05-29 17:54:51 +02:00
Victor Berchet 0db88f34b8 refactor(annotations): stricter types 2015-05-29 11:44:45 +02:00
Victor Berchet 35f0ee510a refactor(transformer): updates in properties syntax 2015-05-29 11:44:44 +02: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
Victor Berchet 0387221da8 fix(ast): fix the size of a list in _evalListCache 2015-05-29 08:07:43 +02:00
vsavkin c39c8ebcd0 feat(change_detection): added onInit and onCheck hooks 2015-05-28 16:46:22 -07:00
Tim Blasi 5d2af54730 feat(dart/transform): Improve constant evaluation
Use `package:analyzer`'s `ConstantEvaluator` to read from the AST.
This cleanly builds values for us from adjacent strings, interpolations,
etc.
2015-05-28 15:18:22 -07:00
Victor Berchet a9be2ebf1b feat: add support for the safe navigation (aka Elvis) operator
fixes #791
2015-05-28 23:03:30 +02:00
Victor Berchet ec2d8cc2c8 feat(binding): throw on binding to a blank alias
fixes #2068
2015-05-28 22:37:29 +02:00
Jeff Cross 01fb8e6635 fix: fix clang errors 2015-05-28 11:08:26 -07:00
Jeff Cross 9d90128463 refactor(ChangeDetection): convert change detection tests to typescript 2015-05-28 10:01:30 -07:00
vsavkin 34cfc9f474 feat(di): added optional self parameter to Parent, Ancestor, and Unbounded 2015-05-28 09:53:06 -07:00
Tim Blasi c065fb1422 feat(dart/transform): Remove unnecessary .ng_deps.dart files
Removes `.ng_deps.dart` files which

1. Do not register any `@Injectable` classes
2. Do not call `initReflector` on any other `.ng_deps.dart` files.

Closes #1929
2015-05-28 07:51:10 -07:00
Tim Blasi cda35101df fix(facade): Fix bug in TS indexOf
startIndex defaults to -1, which in Chrome results in returning -1
regardless of the other parameters.

Added regression tests.
2015-05-28 06:56:24 -07:00
Julie Ralph c32dbad747 feat(tests): add TestComponentBuilder
Adds a TestComponentBuilder for use in component level tests.
For usage examples, see test_component_builder_spec

Closes #1812
2015-05-27 17:15:13 -07:00
vsavkin 30b6542fc8 feat(core): added support for detecting lifecycle events based on interfaces 2015-05-27 16:23:42 -07:00
vsavkin 2b6a653050 feat(core): added missing interfaces for onDestroy and onAllChangesDone lifecycle events 2015-05-27 15:50:08 -07:00
vsavkin 34d75e8918 feat(reflector): added a method to get type's interfaces 2015-05-27 15:50:08 -07:00
Martin Probst 2c25055828 chore: reformat the code base using the clang-format 1.0.15. 2015-05-27 15:28:22 -07:00
Tim Blasi a2770c8a52 refactor(change_detect): Flatten Js change detector template
Update the `ChangeDetectionJITGenerator` for clarity and similarity with
the upcoming Dart generated `ChangeDetector` classes.
2015-05-27 11:50:25 -07:00
Tobias Bosch 4a3fd5e855 fix(di): allow `@Inject(…)` to work in dart2js and dynamic reflection
Note: We can’t write a unit test for this as our unit tests
are running in Dartium, where the error does not occur.
However, we previously had a failure in our e2e tests
in `hello_world/index_dynamic.html`
when removing the TODOs in `application.ts`.

Closes #2185
2015-05-27 10:33:30 -07:00
Tobias Bosch 0c7f05f56a fix(injectable): add missing @Injectables annotations
Closes #2173
2015-05-27 10:31:20 -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
Marc Laval fb42d5908e fix(test): solve CSS discrepancies across browsers
Closes #2177
2015-05-27 14:54:00 +02:00
gdi2290 1db6870a81 docs(ng_for.ts): For => NgFor 2015-05-27 08:09:42 +02:00
Tobias Bosch 79f564be46 refactor(core): ts’ify tests 2015-05-26 17:01:31 -07:00
Tobias Bosch 23d59df81a feat(test_lib): add `containsRegex` 2015-05-26 17:01:31 -07:00
Victor Berchet 26d5d17ebe style: fix clang-format glitches 2015-05-26 21:00:44 +02:00
Victor Berchet 551586ced0 feat(RegExpWrapper): implement a test method 2015-05-26 19:42:17 +02:00
Tobias Bosch d773b6a00a fixed(spy): support `SpyObject` in Typescript as well
- allow `@IMPLEMENTS` as a decorator
- implement empty `noSuchMethod`
2015-05-26 09:25:16 -07:00
Naomi Black f6cd26b0a6 docs(docgen): fixed a typo that was breaking dgeni 2015-05-22 21:47:34 -07:00
vsavkin df59e969cf chore(di): moved tests to typescript 2015-05-22 17:32:21 -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
Marc Laval 4b98ed114e fix(collection): iterator on Map keys is not supported (Safari)
Closes #2096
2015-05-22 15:41:01 +02:00
Marc Laval d308e55e12 fix(collection): new Map(iterable) is not supported (Safari) 2015-05-22 15:40:44 +02:00
Victor Berchet 10bc7e948c feat(key_event): alias esc to escape
fixes #2010
2015-05-22 15:39:21 +02:00
Marc Laval 57b88ec2d6 fix(collection): new Set(iterable) is not supported (IE11, Safari)
Closes #2063
2015-05-22 15:16:49 +02:00
Victor Berchet b1c9bf14b2 feat(ElementInjector): support an arbitrary number of bindings
fixes #1853
2015-05-22 13:42:53 +02:00
Marc Laval b2a24e021f fix(browser_adapter): HTMLStyleElement.innerText does not trigger creation of CSS rules (Firefox) 2015-05-22 13:32:07 +02:00
Marc Laval 661a04798e fix(test): adds longer timers for NgZone and PromisePipe tests (IE11)
Closes #2055
2015-05-22 13:30:49 +02:00
Marc Laval 665ccafd73 fix(browser_adapter): event creation fails (IE11, Firefox) 2015-05-22 13:30:48 +02:00
Marc Laval f35dbb99b5 fix(browser_adapter): element.getBoundingClientRect fails when element not in DOM (IE11) 2015-05-22 13:30:47 +02:00
Marc Laval a393f84fa4 fix(browser_adapter): element.matches only available with prefix (IE11) 2015-05-22 13:30:47 +02:00
Marc Laval 92c2c33a84 fix(browser_adapter): assigning null to document.title sets the title to "null" (IE11, Firefox) 2015-05-22 13:30:46 +02:00
Marc Laval 2287938f5a fix(router): event.defaultPrevented is not reliable (IE11) 2015-05-22 13:30:44 +02:00
Marc Laval 5103f080e9 fix(test): function.name is not available (IE11) 2015-05-22 13:30:44 +02:00
Tobias Bosch cc2c8f6b00 refactor(test): ts’if compiler integration tests. 2015-05-21 17:53:53 -07:00
vsavkin 30c3e5a84e fix(forms): changed forms to create only one value accessor instead of always creating DefaultValueAccessor 2015-05-21 17:31:25 -07:00
yjbanov 2ff3873881 chore(transformers): remove bindProperty hack 2015-05-21 16:58:32 -07:00
Tobias Bosch aec51d616b refactor(ts'ify): ts’ify mocks, directives and test_lib
Also cleans up global types.
2015-05-21 15:33:37 -07:00
vsavkin 00c3693daa feat(forms): migrated forms to typescript 2015-05-21 13:55:15 -07:00
vsavkin fed86fc8ac feat(injector): support forwardRef in toAlias 2015-05-21 09:52:43 -07:00
vsavkin 705ee46f31 fix(di): changed host and view injector to respect visibility 2015-05-21 09:17:56 -07:00
vsavkin f210c41c1f feat(di): changed toFactory to support dependency annotations 2015-05-21 08:34:48 -07:00
Julie Ralph 863eb3c559 chore(testing): update karma-jasmine and jasmine
Jasmine to jasmine-core 2.3.4.
Update tools tests using minijasminenode to directly use jasmine.

See #1860
2015-05-20 21:34: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
Tobias Bosch e61d82b9be refactor(core): ts’ify core 2015-05-20 16:30:41 -07:00
gdi2290 4afd2b4138 feat(PromisePipe): remove ref onDestroy 2015-05-20 14:00:57 -07:00
Rado Kirov c45283216f fix(router): router link should navigate to non-base Url.
While still displaying full base + custom part of url in the href.
2015-05-20 11:01:09 -07:00
Rado Kirov 826af401a9 fix(test_lib): fixes nested beforeEach. 2015-05-20 11:01:09 -07:00
vsavkin 28c2b8f432 fix(element_injector): fixed element injector to resolve dependencies of regular services 2015-05-20 10:56:33 -07:00
Alex Rickabaugh c9ab8e4be8 fix(browser): template elements should have content imported instead of the element itself. 2015-05-20 10:31:12 -07:00
Victor Berchet 91ccc9af98 fix(XHRImpl): fix errors, add a spec
fixes #1715
2015-05-20 08:31:50 +02:00
Misko Hevery a664f5a6de fix: don't call onAllChangesDone on checkNoChanges 2015-05-20 08:27:48 +02:00
eggers 7643d979c7 docs(annotations): fixes 2015-05-20 08:23:35 +02:00
Victor Berchet 0ae89ac096 feat(CD): add support for === and !==
relates to #1500
2015-05-20 07:50:43 +02:00
Victor Berchet 6ec5d5daaf refactor(async): extract timer related functions into a TimerWrapper 2015-05-20 07:47:46 +02:00
vsavkin 62b1a08f06 refactor(reflection): improved error message 2015-05-19 21:17:52 -07:00
Tobias Bosch 8aa3fcfb63 chore(build): don’t include `export var __esModule = true` in every file
But do it during the build process for cjs.
Right now we only need this when we transpile from ts
directly to es5. This is only the case in our
cis build, as for our browser build we only transpile
from ts to es6 via ts and then use traceur to do
the rest.
2015-05-19 15:12:59 -07:00
Tobias Bosch 1beadb8607 refactor(render): ts’ify render api 2015-05-19 15:12:59 -07:00
Brian Ford 791caf0037 fix(router): use appRootComponentToken to get root route configs
Closes #1947
2015-05-19 14:36:45 -07:00
Yegor Jbanov 8ab773538b fix(errors): require passing stack traces explicitly in ng2 own code 2015-05-19 12:48:00 -07:00
Peter Bacon Darwin 8b9400ad92 docs(di/injector): remove invalid tab chars
These tabs were breaking the jade syntax generation
2015-05-19 14:38:07 +01:00
Victor Berchet 0f002a5b18 feat(fakeAsync): allow simulating the passage of time 2015-05-19 06:51:15 +02: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
Brian Ford 83b97c485b refactor(router): use DynamicComponentLoader instead of ViewContainer 2015-05-18 15:57:08 -07:00
Brian Ford 5db89071d4 fix(router): improve route matching priorities 2015-05-18 15:57:08 -07:00
Brian Ford c29ab86d85 refactor(router): improve control flow of descendant route activation 2015-05-18 15:57:08 -07:00
gdi2290 f9fd4926ef docs(pipes): fix @View
we all copy/pasta ObservablePipe which had the typo

Closes #1958
2015-05-18 14:34:37 -07:00
gdi2290 986038242a feat(change_detection): json pipe
Closes #1957
2015-05-18 14:34:37 -07:00
Josef Meier 8e84f8a1c4 chore: don't throw if paramTypes is undefined.
Closes #1955
2015-05-18 14:34:37 -07:00
Tim Blasi edfbc25768 style(change detect): Fix typo unitialized => uninitialized
Closes #1928
2015-05-18 14:34:37 -07:00
Tim Blasi 05a1c6c183 perf(compiler): Avoid unnecessary List concats
Update `BindingRecordsCreator#getBindingRecords` and `ProtoRecordBuilder#addAst`
to avoid unnecessary calls to `ListWrapper.concat`.

Closes #1905
2015-05-18 14:34:36 -07:00
Pawel Kozlowski 3011cd86bd feat(compiler): special-case class attribute in hostAttributes
Closes #1774

Closes #1841
2015-05-18 14:34:36 -07:00
vsavkin 11e4385173 feat(forms): improved error messages
Closes #1839
2015-05-18 14:34:36 -07:00
Victor Berchet ad29b12cde doc(NgFor): fix inline doc 2015-05-18 23:12:41 +02:00
Victor Berchet b033416a45 doc(DI): fix inline doc in binding.ts
fixes #1894
2015-05-18 23:10:41 +02:00
Victor Berchet 7310b09a1a doc(UrlResolver): inline doc
fixes #1732
2015-05-18 23:09:35 +02:00
Jeremy Elbourn bb2eda2d15 feat(element_injector): allow @Optional for ProtoViewRef 2015-05-18 12:48:33 -07:00
Victor Berchet 0114cd97b6 refactor(RouteRegistry): optimize recognize() 2015-05-18 19:32:33 +02:00
Victor Berchet fc13cdab3a refactor(router): add types 2015-05-18 19:32:33 +02: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
Misko Hevery 1eea2b254e feat: allow for forward references in injection
It is possible for a class defined first to be referencing a class defined later,
and as a result at the time of the definition it is not possible to access the later's
class reference. This allows to refer to the later defined class through
a closure.Closes #1891
2015-05-15 21:12:57 -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
Matan Lurey a38a0d6f87 Merge pull request #1909 from angular/view-ref-return-types
Update view_ref.js
2015-05-15 12:32:22 -07:00
gdi2290 7a4a635399 feat(change_detection): uppercase and lowercase pipes
because the world needs more uppercase madness

[✔] clang-format
[✔] tests
2015-05-15 19:46:52 +02:00
gdi2290 557d54b3de feat(facade): toUpperCase and toLowerCase 2015-05-15 19:46:52 +02:00
Victor Berchet c47902a471 refactor(reflector): improve types 2015-05-15 19:26:06 +02: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
Matan Lurey 6ad5fa0d9d Update view_ref.js
Add return types.
2015-05-14 12:36:16 -07:00
PatrickJS 8ad0205948 docs(promise_pipe.ts): correct "async" pipe
the syntax is now combined with `|async` rather than separate `|promise`
2015-05-14 17:25:46 +02:00
gdi2290 1d11fdecdc docs(annotations): correct List for directives for Component
@Component takes a List of directives

https://github.com/angular/angular/blob/master/modules/angular2/src/core
/annotations_impl/annotations.js#L867
2015-05-14 08:13:54 -07: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
Tim Blasi 5114411749 perf(dart): Improve Dart ListWrapper#concat
Improve implementation of `ListWrapper#concat` to take advantage of our
knowledge of input list sizes.
2015-05-13 16:30:50 -07:00
vsavkin 08f21dbf51 feat(change_detection): implemented change detection that can be configured with pregenerated change detectors 2015-05-13 16:23:22 -07:00
vsavkin d8c7c274e4 refactor(change_detector): extracted ChangeDetectorDefinition 2015-05-13 16:23:22 -07:00
vsavkin 685a6507b6 feat(compiler): added support for [()] syntax 2015-05-13 16:08:59 -07:00
Jacob MacDonald 846354473d chore(cleanup): Remove some unused files. 2015-05-13 13:56:54 -07:00
Brian Ford 390cfb793b fix(router): generate links for router-link with baseHref 2015-05-13 12:22:45 -07:00
Brian Ford 17392f663f fix(router): sort possible routes by cost 2015-05-13 11:57:57 -07:00
Victor Berchet 8b6fa1cf19 doc: fix inline docs 2015-05-13 11:56:51 +02:00
Chirayu Krishnappa af9dcad8e3 fix(facade): MapWrapper.createFromPairs
Closes #1640
2015-05-12 16:10:00 -07: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 e9f236b70f chore: rename switch to ng-switch 2015-05-12 15:32:44 -07:00
Misko Hevery 78d3f62b6a chore: rename non-bindable to ng-non-bindable 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
Misko Hevery f302f70330 chore: convert dom module to typescript 2015-05-12 12:59:53 -07:00
Jeff Cross 96b0a1c75e refactor(PromisePipe): use lexical this inside of transform 2015-05-12 12:40:13 -07:00
Victor Berchet e11c20541a refactor(VmTurnZone): renamed to NgZone
BREAKING CHANGE:

VmTurnZone has been renamed to NgZone.

- The public API has not chnanged,
- The "outer" zone is now named "mount" zone (private to NgZone).
2015-05-12 21:03:24 +02:00
Victor Berchet c75e216871 refactor(VmTurnZone): outer zone = root zone 2015-05-12 21:03:24 +02:00
Victor Berchet fd1d60f03b refactor(VmTurnZone): use the browser microtask queue for JS 2015-05-12 21:03:24 +02:00
Victor Berchet e8a6c95e2a feat(VmTurnZone): Rework the implementation to minimize change detection runs
Before this PR there were only 2 zones: root zone = outer zone > inner
zone.
This PR creates the outer zone as a fork of the root zone: root > outer
> inner.

By doing this it is possible to detected microtasks scheduling in the
outer zone and run the change detection less often (no more than one
time per VM turn).

The PR also introduce a Promise monkey patch for the JS implementation.
It makes Promises aware of microtasks and again allow running the change
detection only once per turn.
2015-05-12 21:03:24 +02:00
yjbanov 358a6750ed feat(di): support type literals in DI 2015-05-12 10:57:53 -07:00
Pawel Kozlowski 229e770a1d refactor(forms): rename FormDirectives to formDirectives
BREAKING CHANGE:

A collection of all the form directives is exported
under `formDirectives`
while those were previously available
under `FormDirectives`.

Closes #1804
2015-05-12 18:44:25 +02:00
Pawel Kozlowski 5036086fb3 fix(forms): export directives as const in Dart
Fixes #1283
2015-05-12 18:44:25 +02:00
Tim Blasi 97d24563f4 feat(dart/transform): Inline `templateUrl` values
Modify DirectiveProcessor to inline `templateUrl` values to avoid making
additional browser requests.

Closes #1035
2015-05-12 09:08:56 -07:00
Pawel Kozlowski 655ed851f0 refactor(facade/lang): remove unneded semicolons
Those were previously enforced incorrectly by clang-format

Closes #1816
2015-05-12 08:50:44 +02:00
Rado Kirov a574154108 fix(router): add baseUrl to relative paths, but not absolute.
Closes #1783
2015-05-11 18:55:24 -07:00
vsavkin 7f976381d5 fix(view): fixed ProtoViewFactory to get all property bindings 2015-05-11 17:38:34 -07:00
Brian Ford ac80df0959 fix(router): reuse common parent components 2015-05-11 15:49:40 -07:00
Brian Ford aff85b5037 feat(facade): add equals method to StringMapWrapper 2015-05-11 15:49:40 -07:00
Jeff Cross 5691063ba0 refactor(ChangeDetection): rename AsyncPipe to ObservablePipe
The async pipe in templates will now delegate to both Observable pipe or Promise pipe,
whichever first says it can support the input. Therefore, it's beneficial to disambiguate
the name of the AsyncPipe/AsyncPipeFactory constructors to reflect that these actually
support only Observables.
2015-05-11 14:25:27 -07:00
Jeff Cross 7498758584 feat(PromisePipe): add pipe for promises 2015-05-11 14:23:46 -07:00
vsavkin f9c1de46b3 feat(compiler): added support for host actions 2015-05-11 13:28:19 -07:00
vsavkin a9ce0f7afb cleanup(di): use typescript initialization idioms 2015-05-11 12:34:22 -07:00
Rado Kirov 77d1fc149a fix(router): router-link works without params
Router-link attaches a listener to prevent default behavior and
navigate.

Closes: 1689
2015-05-11 11:58:38 -07:00
Rado Kirov c2a42d5d2b fix(location): dartium does not like pushState with null.
According to
https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history
the value of the title parameter is irrelevant anyways.
2015-05-11 11:48:45 -07:00
Jacob MacDonald 01d5c29513 fix(transformer): remove classDefParser in favor of hardcoded strings to speed up build 2015-05-11 10:45:02 -07:00
Kevin Moore 7844e3a275 chore: dartfmt Dart code in the repo 2015-05-11 09:50:33 -07:00
Pawel Kozlowski 4665726f48 feat(lang): support const expressions in TS/JS and Dart
Closes #1796
2015-05-11 12:11:24 +02: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 2185e7cee9 feat(di): expose parent injector 2015-05-08 17:11:27 -07:00
yjbanov 1a0da11e55 feat(di): components can self-publish via publishAs 2015-05-08 16:13:00 -07:00
Tim Blasi abc8878547 feat(dart/transform): Reuse readDirectiveMetadata in plugin
Share code for parsing `DirectiveMetadata` values between the
transformer and the analyzer plugin.
2015-05-08 14:34:16 -07:00
Brian Ford 853d1de6ec fix(router): strip base href from URLs when navigating 2015-05-08 13:51:43 -07:00
Brian Ford 84dc6ae76b fix(test_lib): spy funcs should match null arguments 2015-05-08 13:51:43 -07:00
Brian Ford 05219a54cd feat(dom): add getBaseHref method 2015-05-08 13:51:42 -07:00
Kevin Western 42f6baeaec Fix documentation for toFactory and toAsyncFactory
The bound String classes should have a dependency on Number, not String.

Closes #1654
2015-05-08 13:40:12 -07:00
Matan Lurey 2cb066215a Add correct type to TestBed.createView
Closes #1727
2015-05-08 13:17:42 -07:00
Tim Blasi 200e190f70 fix(dart/transform): Handle `hostAttributes` in DirectiveMetadata
Handle `hostAttributes` in the transformer.
`hostAttributes` was introduced in 51839ca677

Closes #1742
2015-05-08 11:19:11 -07:00
Tim Blasi 44f829dbc6 feat(dart/transform): Use the render Compiler and the DirectiveParser
Update the `TemplateCompile` step to use the full render `Compiler`.

Provide `DirectiveMetadata` for `ViewDefinition` objects and use it to
run the `DirectiveParser` step of the render compile pipeline.
2015-05-08 11:18:40 -07:00
vsavkin d717529e9a fix(change_detection): updated dynamic change detector not to mutate when throwing
Closes #1762
2015-05-08 10:46:08 -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
John Jelinek IV d2507ac760 Add full example to FormBuilder docs 2015-05-08 16:35:25 +02: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
Matthew Hill 5d9e573b3e docs(annotations): differentiate between component definitions and component instances
Closes #1661
2015-05-08 14:50:33 +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
PatrickJS 93c331d103 fix(decorators.es6): export Directive decorator
Closes #1688
2015-05-07 15:12:22 -07:00