Commit Graph

970 Commits

Author SHA1 Message Date
Jeff Cross 88a5b8da0f chore(transform): move transform module to modules_dart
The build/pure-packages.dart gulp task has also been updated to move the files into the angular2 tree.
Closes #3729
2015-08-24 03:39:07 +00:00
Rado Kirov 92da5430e7 fix(injector): support getRootInjectors on dehydrated injectors.
Closes #3760
2015-08-24 02:41:43 +00:00
Marc Laval 50eee42668 chore(build): add Android to CI
Closes #3756
2015-08-24 00:28:07 +02:00
Pawel Kozlowski b039ec3da3 fix(parser): detect and report interpolation in expressions
Fixes #3645

Closes #3750
2015-08-23 14:06:30 +00:00
Pawel Kozlowski c4044102d6 test(ViewMetadata): use ViewMetadata consistently in tests
Closes #3746
2015-08-23 10:47:23 +00:00
Pawel Kozlowski 215c4aa8fb fix(compiler): detect and report error for views with empty templateUrl
Fixes #3762

Closes #3768
2015-08-23 07:26:56 +00:00
Pawel Kozlowski 3871f89119 fix(ViewLoader): provide componentId in missing template / templateUrl errors
Befor this change it wasn't clear which component is faulty
2015-08-23 07:26:56 +00:00
Misko Hevery 5d403966d5 refactor: rename web-workers to web_workers
Closes #3683
2015-08-22 14:20:33 -07:00
vsavkin e8e430e630 feat(change_detection): added support for observable components and directives 2015-08-21 15:44:45 -07:00
vsavkin a9ce454b21 fix(change_detection): fixed reflect properties as attributes
Closes #3761
2015-08-21 19:08:32 +00:00
vsavkin b6146394ae refactor(change_detection): replaced devMode with ChangeDetectorGenConfig 2015-08-21 19:08:32 +00:00
Marc Laval 65344fcac9 chore(build): add IE9 to CI
Closes #3747
2015-08-21 15:46:26 +00:00
vsavkin d2d0715568 feat(change_detection): do not reparse AST when using generated detectors 2015-08-21 05:16:31 +00:00
Misko Hevery b986c54079 chore: remove int in favor for number
Closes #3511
2015-08-21 05:10:31 +00:00
yjbanov 8336881a85 feat: track unused reflection data 2015-08-20 18:20:53 -07:00
Marc Laval b0d27ee896 chore(build): add IE10 to CI 2015-08-21 00:16:34 +02:00
Marc Laval 1c9be9b5aa chore(build): add Firefox to CI 2015-08-21 00:16:33 +02:00
vsavkin 195c5c21d4 fix(change_detection): update the right change detector when using ON_PUSH mode
Previously, in a case where you have a mix of ON_PUSH and DEFAULT detectors, Angular would update the status of a wrong detector.
2015-08-20 21:55:50 +00:00
Jason Teplitz 0b59e664ec feat(WebWorker) Add channel support to MessageBus
closes #3661 and #3686
2015-08-19 10:57:22 -07:00
Tim Blasi 104302a958 refactor(dart/transform): Remove unnecessary getter/setter codegen
Currently the transformer generates all getters and setters even when
creating pre-generated change detectors, which remove the need for them.

Generate getters and setters via the model provided by `ProtoViewDto`,
which contains enough information to allow omitting unnecessary getters
and setters from code output.

Allow generating getters, setters, and method names which are Dart
pseudo keywords.

Closes #3489
2015-08-19 17:36:12 +00:00
Marc Laval 873b6da120 chore(test): disable tests based on Intl API in non-Chrome browsers
Closes #3692
2015-08-19 09:45:34 +02:00
Misko Hevery ccfadb9b47 refactor: make bindings/directives names consistent
BREAKING CHANGE

- `routerDirectives` => `ROUTER_DIRECTIVES`
- `routerInjectables` => `ROUTER_BINDINGS`
- `ELEMENT_PROBE_CONFIG` => `ELEMENT_PROBE_BINDINGS`
2015-08-18 21:23:26 -07:00
Brian Ford 72e0b8f7dc fix(router): allow router-link to link to redirects
Closes #3335

Closes #3624
2015-08-19 01:34:46 +00:00
Brian Ford b5c4d8ba79 feat(facade): add maximum method for ListWrapper 2015-08-19 01:34:45 +00:00
Brian Ford 5c95b376b5 fix(router): subscribe should return subscription
Closes #3491

Closes #3695
2015-08-19 01:34:08 +00:00
Marc Laval 3b4965279c feat(browser): support Edge
Closes #3667
2015-08-18 23:07:59 +00:00
Rado Kirov 272ad61ab1 fix(injectors): reset the construction counter in dynamic strategy.
Adds tests for hydrate / dehydrate in cycle.

Closes #3635
2015-08-18 21:03:20 +00:00
gdi2290 235dec26fc fix(browser_adapter.ts): baseElement.getAttribute
currently throwing an error
```error
Error during instantiation of LocationStrategy! (RouterLink -> Router
-> Location -> LocationStrategy).
ORIGINAL ERROR: TypeError: baseElement.attr is not a function
```

Closes #3214
2015-08-18 19:07:47 +00:00
vsavkin cbfc9cb344 feat(change_detection): added an experimental support for observables 2015-08-18 19:00:04 +00:00
Daniel Rasmuson ed81cb94b0 feat(router): user metadata in route configs
Provide the ability to attach custom data onto a route and retrieve
that data as an injectable (RouteData) inside the component.

Closes #2777

Closes #3541
2015-08-18 10:33:19 -07:00
Victor Berchet 1f54e64fcf feat(PropertyBindingParser): support onbubble-event as an alternate syntax for (^event)
fixes #3448

Closes #3616
2015-08-18 17:30:48 +00:00
Misko Hevery ea6673947c refactor: rename annotations to metadata
BREAKING CHANGE (maybe)

Well as long as our customers use public API this should not be a
breaking change, but we have changed import structure as well as
internal names, so it could be breaking.

import:
  angular2/annotations => angular2/metadata

Classes:
  *Annotations => *Metadata
  renderer.DirectiveMetadata => renderer.RendererDirectiveMetadata
  renderer.ElementBinder => renderer.RendererElementBinder
  impl.Directive => impl.DirectiveMetadata
  impl.Component => impl.ComponentMetadata
  impl.View => impl.ViewMetadata

Closes #3660
2015-08-17 21:23:25 +00:00
vsavkin 5e6317fecc feat(change_detection): request a change detection check when an event happens
Closes #3679
2015-08-17 19:08:03 +00:00
vsavkin 823fa4689e refactor(change_detection): generate handleEvent only when necessary 2015-08-17 19:08:03 +00:00
Rado Kirov 6c9e712c34 fix(query): do not visit dehydrated injectors. 2015-08-17 11:43:44 -07:00
vsavkin 4845583dcf refactor(change_detector): made change detection responsible for processing events
Closes #3666
2015-08-17 15:39:00 +00:00
Pascal Precht a06f48e357 test(query_integration): remove duplicated change detection call
Closes #3673
2015-08-17 09:22:10 +00:00
Jason Teplitz 296851797b fix(WebWorkers): Run XHR requests on the UI
Fixes issues in dart where dart:html is not available in isolates and
allows for better profiling of XHR requests

Closes #3652
2015-08-15 21:54:51 +00:00
Brian Ford 26d2ea8afc fix(router): fix regression with generating links to async routes
Closes #3650
2015-08-14 22:32:48 +00:00
Rado Kirov 2686316c90 test(query): adds a view query test in presence of a long ng-for.
Closes #3638

Closes #3649
2015-08-14 21:04:29 +00:00
gdi2290 35a83b495a feat(query_list): delegate `toString` to `_results` array
Closes #3004
2015-08-14 03:42:11 +00:00
Victor Berchet 2fcb4cb769 test(Router): increase the timeout for the back button test
The test would fail on Ubuntu 15.04 + Chrome 46 with the standard
timeout.
2015-08-13 17:50:16 -07:00
Misko Hevery b7837389d7 refactor: Remove isDart from public API
BREAKING CHANGE:

- `IS_DARTIUM` no longer exported
2015-08-13 21:18:31 +00:00
Misko Hevery 5c328adb4b refactor(di): Visibility.(Private|Public|PublicAndPrivate)
BREAKING CHANGE:

Rename:
- `PRIVATE` => `Visibility.Private`
- `PUBLIC` => `Visibility.Public`
- `PUBLIC_AND_PRIVATE` => `Visibility.PublicAndPrivate`
2015-08-13 21:18:31 +00:00
Misko Hevery 60af19f0e1 refactor: rename all const to UPPER_CASE
Closes #3573

BREAKING CHANGE

Rename:
- `appComponentTypeToken` => `APP_COMPONENT`
- `coreDirectives` => `CORE_DIRECTIVES`
- `formDirectives` => `FORM_DIRECTIVES`
- `formInjectables` => `FORM_BINDINGS`
- `httpInjectables` => `HTTP_BINDINGS`
- `jsonpInjectables` => `JSONP_BINDINGS`
- `PROTO_CHANGE_DETECTOR_KEY` => `PROTO_CHANGE_DETECTOR`
- `appComponentRefPromiseToken` => `APP_COMPONENT_REF_PROMISE`
- `appComponentTypeToken` => `APP_COMPONENT`
- `undefinedValue` => `UNDEFINED`
- `formDirectives` => `FORM_DIRECTIVES`
- `DOCUMENT_TOKEN` => `DOCUMENT`
- `APP_ID_TOKEN` => `APP_ID`
- `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN` => `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE`
- `appBaseHrefToken` => `APP_BASE_HREF`
2015-08-13 21:18:31 +00:00
vsavkin 416fd085b1 refactor(pipes): removed BasePipeTrasnform
Closes #3608
2015-08-13 01:39:21 +00:00
vsavkin 839edaa15b feat(pipes): changed PipeTransform to make onDestroy optional
BREAKING CHANGE:

Before:
  Angular called onDestroy on all pipes.

After:
  Angular calls onDestroy only on pipes that have the onDestroy method.
2015-08-13 01:39:21 +00:00
Tim Blasi aa480fee72 feat(dart/transform): Support `part` directives
Allow users to split libraries using the `part` directive.

Closes #1817
2015-08-13 00:28:42 +00:00
Pawel Kozlowski ed25a29cc8 fix(NgClass): take initial classes into account during cleanup
Closes #3557
2015-08-12 20:08:03 +00:00
Pawel Kozlowski a7a1851c0f feat(compiler): allow binding to className using class alias
Closes #2364
2015-08-12 20:08:03 +00:00
Pawel Kozlowski 218b037d98 test(NgClass): remove code duplication in tests 2015-08-12 10:29:37 +02:00
Rado Kirov 2150a8f9d1 feat(query): view query is properly updated when dom changes.
Fixes a bug in view manager util where sibling injector is not correctly
calculated.

ViewQuery no longer includes the view's initiating component injector.

Includes some refactoring of view methods and a removal of a polymorphic
map call.

Closes #3033

Closes #3439
2015-08-12 06:16:09 +00:00
Tobias Bosch 585ea5d600 feat(query): allow to query for `TemplateRef`
Part of #1989

Closes #3202
2015-08-12 01:51:18 +00:00
vsavkin 5b5d31fa9a feat(pipe): added the Pipe decorator and the pipe property to View
BREAKING CHANGE:
    Instead of configuring pipes via a Pipes object, now you can configure them by providing the pipes property to the View decorator.

    @Pipe({
      name: 'double'
    })
    class DoublePipe {
      transform(value, args) { return value * 2; }
    }

    @View({
      template: '{{ 10 | double}}'
      pipes: [DoublePipe]
    })
    class CustomComponent {}

Closes #3572
2015-08-12 00:38:40 +00:00
Jeff Cross 5a405011de refactor(http): move http files to top-level module
Closes #2680
Closes #3417
2015-08-11 22:32:17 +00:00
Brian Ford 903a0f0513 fix(router): throw when component in route config is not defined
Close #3265

Closes #3569
2015-08-11 21:21:32 +00:00
Caitlin Potter 77d3668432 feat(http): serialize search parameters from request options
- Extends URLSearchParams API to include operations for combining
  different URLSearchParams objects:

  These new methods include:
  setAll(otherParams): performs `this.set(key, values[0])` for each
      key/value-list pair in `otherParams`

  appendAll(otherParams): performs `this.append(key, values)` for
      each key/value-list pair in `otherParams`

  replaceAll(otherParams): for each key/value-list pair in
      `otherParams`, replaces current set of values for `key` with
      a copy of the list of values.

- RequestOptions do not merge search params automatically (because
  there are multiple ways to do this). Instead, they replace any
  existing `search` field if `search` is provided. Explicit merging
  is required if merging is desirable.

- Some extra test coverage added.

Closes #2417
Closes #3020
2015-08-10 16:29:36 -07:00
Pawel Kozlowski 4f5e405676 fix(UrlResolver): encode URLs before resolving
This commits makes JS implementation to behave like Dart one.

Fixes #3543

Closes #3545
2015-08-10 19:50:10 +00:00
Brian Ford ac6227e434 feat(router): auxiliary routes
Closes #2775
2015-08-10 10:47:37 -07:00
Matias Niemelä 24eabb9bb1 test(matchers): add support for toHaveClass in tests 2015-08-08 02:22:45 +00:00
jteplitz a1c53eec6b Refactor(WebWorker): Unify WebWorker naming
Closes #3205
2015-08-07 14:43:52 -07:00
vsavkin 2dcf714d2b refactor(pipes): use Injector instead of pipe factories for pipe instantiation
BREAKING CHANGE
    - Pipe factories have been removed.
    - PIpe names to pipe implementations are 1-to-1  instead of 1-to-*

 Before:
     class DateFormatter {
         transform(date, args){}
     }

     class DateFormatterFactory {
       supporst(obj) { return true; }
       create(cdRef) { return new DateFormatter(); }
     }
     new Pipes({date: [new DateFormatterFactory()]})

After
    class DateFormatter {
      transform(date, args){}
    }
    new Pipes({date: DateFormatter})
2015-08-07 10:02:11 -07:00
vsavkin 06da60f4b7 feat(di): added resolveAndInstantiate and instantiateResolved to Injector
These two methods can be used to create objects in the context of the injector without storing them in the injector.
2015-08-07 08:29:19 -07:00
Pawel Kozlowski ff1b110ae1 fix(CSSClass): change selector to ng-class
BREAKING CHANGE:

The selector for the CSSClass directive was changed
from [class] to [ng-class]. The directive itself was
renamed from CSSClass to NgClass

Closes #3498
2015-08-07 14:56:41 +02:00
Pawel Kozlowski 748c2d6c97 fix(compiler): strip <script> tag from templates
Fixes #2766
Closes #3486
2015-08-07 11:54:33 +00:00
Marc Laval a37de36fa6 fix(test_lib): run unit tests in default Documnent
Closes #3501
Fixes #3475
2015-08-07 09:57:59 +02:00
vsavkin 106a28b8dc feat(refactor): replaced ObservablePipe and PromisePipe with AsyncPipe 2015-08-07 02:10:32 +00:00
Tim Blasi 40a3cd2ab1 style(dart/transform): Do not format generated code by default
Formatting code requires time and memory during the build -- do not do
it unless explicitly requested via a parameter to the transformer.

Add an entry to the
[wiki](https://github.com/angular/angular/wiki/Angular-2-Dart-Transformer)
describing the added parameter.
2015-08-06 23:32:01 +00:00
Tim Blasi 3db0ae1dac refactor(dart/transform): Show friendly messages for transform failures
Previously, the error messages coming out of the Dart transformer were
opaque when those errors came from the analyzer (for example, analyzer
parse errors). Log more useful errors when they are caught by the
transform code.
2015-08-06 22:28:10 +00:00
vsavkin 07b9be798c fix(exception_handler): log errors that are thrown by the compiler 2015-08-06 15:26:24 -07:00
Alex Eagle b4a062983b fix(dart): @proxy is a value, not a factory
Previously I added parens everywhere to make this @proxy() because our typing indicated
it was a function that returned a decorator, but this breaks dart. Instead, the typing needs
to be changed.

Fixes #3494
2015-08-06 10:02:49 -07:00
Tim Blasi f11f4e0b45 style(dart): Format with dartfmt v0.2.0
Format all pure Dart code with package:dart_style v0.2.0

Command:
```
find -type f -name "*.dart" | xargs dartformat -w
```
2015-08-05 11:04:29 -07:00
Marc Laval 166688348a chore(browsers): fix failing tests in IE11
Closes #3388
2015-08-04 22:45:46 +02:00
Pascal Precht 39ad50657e refactor(di/tests): removes unecessary for-loop
Closes #3268
2015-08-04 20:14:04 +00:00
Martin Probst 861be30021 feat: export a proper promise type.
Promise used to be typed as any, giving incorrect results. This change
fixes places that were incorrectly typed and re-exports the actual
Promise type from es6-promise.

It also fixes a series of compilation errors discovered/triggered by
this change.
2015-08-04 19:56:02 +00:00
Tim Blasi c58b0ff787 refactor(change_detect): Share more codegen logic
Move more logic in our codegen into a shared util which is called by the
Jit & Prege change detector code.
2015-08-04 18:55:07 +00:00
vsavkin 392de4af67 feat(pipes): replaces iterable and key value diffing pipes with services
BREAKING CHANGE:
    Directives that previously injected Pipes to get iterableDiff or keyvalueDiff, now should inject IterableDiffers and KeyValueDiffers.
2015-08-04 10:39:55 -07:00
Jeremy Elbourn c20a5d65d8 fix(compiler): Allow components to use any style of selector. Fixes #1602 2015-08-04 09:34:03 -07:00
Pawel Kozlowski 4422819754 fix(parser): detect empty expression in strings to interpolate
Fixes #3412

Closes #3451
2015-08-04 08:44:14 +02:00
gdi2290 cfedc77ce1 test(XHRConnection): normalize responseText and response
normalize xhr.responseText and xhr.response

- [x] Tests

Closes #2882
2015-08-04 00:39:11 +00:00
gdi2290 96eefdfebc fix(XHRConnection): use xhr status code
closes #2841

- [x] Tests
2015-08-04 00:39:11 +00:00
Matias Niemelä 7bf7ec6d9c fix(router): ensure navigation via back button works
The router will now navigate and respect the current address value
accordingly whenever a popState event is handled.

Closes #2201
2015-08-03 22:24:57 +00:00
Matias Niemelä 60f38eab78 feat(router): add `back()` support to `MockLocationStrategy` 2015-08-03 22:24:57 +00:00
Marc Laval 8822460858 chore(browsers): fix failing tests in Firefox
Closes #3386
2015-08-03 12:17:44 +02:00
Misko Hevery 77875a270d feat: implement web-tracing-framework support
This includes implementation and minimal instrumentation

Closes #2610
2015-07-31 23:04:05 +00:00
Misko Hevery 39b0286d6b fix: remove unused imports 2015-07-31 20:40:33 +00:00
vsavkin 3437d56904 feat(core): made directives shadow native element properties
BREAKING CHANGE
    Previously, if an element had a property, Angular would update that property even if there was a directive placed on the same element with the same property. Now, the directive would have to explicitly update the native elmement by either using hostProperties or the renderer.
2015-07-31 20:29:57 +00:00
Alex Eagle 3c58878b19 chore(build): Upgrade to TypeScript@1.5.3
This change also makes us compliant with 1.6.0-dev compiler,
so we can do some experiments with apps that use 1.6 features
and compile against Angular.

We should probably add a travis build for 1.6 so we stay compatible
with both versions.
2015-07-31 20:01:27 +00:00
Jason Teplitz c5cb7009ca feat(WebWorkers): Add WebWorker Todo Example. Add support for more DOM events.
Fixed breakage caused by previous DI commit in WebWorker Todo example
2015-07-31 19:48:18 +00:00
vsavkin adc27398fd perf(change_detection): do not generate onAllChangesDone when not needed 2015-07-31 19:23:00 +00:00
Tobias Bosch dd06a871b7 fix(render): allow to configure when templates are serialized to strings
Introduces the injectable `TemplateCloner` that can be configured via the new token `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN`.

Also replaces `document.adoptNode` with `document.importNode` as otherwise
custom elements are not triggered in chrome 43.

Closes #3418
Closes #3433
2015-07-31 12:04:32 -07:00
Tobias Bosch 014b6cb397 Revert "feat(WebWorkers): Add WebWorker Todo Example. Add support for more DOM events."
This reverts commit d44827a4c5.

This broke master due to a race condition in our presubmit queue.
2015-07-31 11:40:15 -07:00
Jason Teplitz d44827a4c5 feat(WebWorkers): Add WebWorker Todo Example. Add support for more DOM events. 2015-07-31 18:33:12 +00:00
vsavkin 3cda7128d0 cleanup(di): renamed viewInjector and hostInjector
BREAKING CHANGE
    Replace viewInjector with viewBindings
    Replace hostInjector with bindings
2015-07-31 09:49:51 -07:00
Pawel Kozlowski 0a40024995 test(integration): minor tests cleanup
Closes #3329
2015-07-31 10:52:42 +02:00
vsavkin 985627bd65 cleanup(DI): clean up visibility decorators
BREAKING CHANGE:
    Replace @Ancestor() with @Host() @SkipSelf()
    Replace @Unbounded() wwith @SkipSelf()
    Replace @Ancestor({self:true}) with @Host()
    Replace @Unbounded({self:true}) with nothing
    Replace new AncestorMetadata() with [new HostMetadata(), new SkipSelfMetadata()]
    Replace new UnboundedMetadata() with new SkipSelfMetadata()
    Replace new Ancestor({self:true}) with new HostMetadata()
2015-07-31 02:30:26 +00:00
vsavkin 71ea19902a perf(change_detection): removed the currentProto property 2015-07-31 00:31:11 +00:00
Pawel Kozlowski 2768158eaf tests(ProtoViewBuilder): host properties binding to unknown props
When binding a host property, we shouldn't try to bind to any
directive properties that might exist on a host element

Closes #3383
2015-07-30 16:16:35 -07:00
Jeff Cross 4e76cac5b7 fix(core): export LifeCycle at top-level modules
LifeCycle can now be imported via angular2/angular2 or
angular2/core, so that end users can inject it without
having to use the full source path.

Closes #3395
2015-07-30 21:52:29 +00:00
Tobias Bosch 0dbdd5cd3c refactor(render): don’t store DOM nodes but store strings for big ProtoViews.
Also inserts comment nodes before/after projected nodes so that text nodes don’t get merged when we serialize/deserialize them.

Closes #3356
First part of #3364
2015-07-30 14:11:13 -07:00
Yegor Jbanov 29095766e6 fix(bootstrap): fix expressions containing bootstrap (fixes #3309) 2015-07-30 12:06:53 -07:00
Jason Teplitz 7b834e02ec feat(WebWorkers) Add DOM event support
closes #3046
2015-07-29 23:34:43 +00:00
Rado Kirov 34acef58e7 fix(query): view query should not be updated when subviews are attached. 2015-07-29 22:33:15 +00:00
vsavkin c1ee943533 perf(change_detection): do not check intermediate results 2015-07-29 21:58:29 +00:00
Jeremy Elbourn f7d7789915 fix(decorators): stop directives inheriting parent class decorators.
Fixes #2291
2015-07-29 21:23:31 +00:00
Tim Blasi 9c19eb906b refactor(change_detect): Move (de)hydrate methods into superclass
Move the implementation of `(de)hydrate`, `hydrated`, and
`detectChangesInRecords` into `AbstractChangeDetector`.

Add comments clarifying the contract between `AbstractChangeDetector`
and its subclasses.

Closes #3245
2015-07-29 13:12:53 -07:00
yjbanov 73b7d99dc4 fix(style_url_resolver): fix data: url resolution 2015-07-29 11:24:17 -07:00
Tim Blasi 192cf9ddf5 refactor(change_detect): Move common fields to AbstractChangeDetector
Move fields common to Dynamic, Jit, and Pregen change detectors into the
`AbstractChangeDetector` superclass to save on codegen size and reduce
code duplication.

Update to #3248, closes #3243
2015-07-29 10:46:49 -07:00
Pawel Kozlowski d894aa9101 feat(compiler): introduce schema for elements
Closes #3353
2015-07-29 19:40:46 +02:00
Tobias Bosch 16e3d7e96e refactor(shadow_dom): remove `ShadowDomStrategy` in favor of `@View(encapsulation)`
BREAKING CHANGES:
- `ShadowDomStrategy` was removed. To specify the encapsulation of a component use `@View(encapsulation: ViewEncapsulation.NONE | ViewEncapsulation.EMULATED | ViewEncapsulation.NATIVE)`
- The default encapsulation strategy is now `ViewEncapsulation.EMULATED` if a component contains styles and `ViewEncapsulation.NONE` if it does not. Before this was always `NONE`.
- `ViewLoader` now returns the template as a string and the styles as a separate array
2015-07-28 22:33:11 -07:00
Jacob MacDonald 2faa89852b fix(transformer): Fix generation of `annotations` argument when registering functions. 2015-07-28 15:26:33 -07:00
Tim Blasi d84993faf1 refactor(change_detect): Move (de)hydrate logic into dedicated methods
Call new `(de)hydrateDirectives` methods from `(de)hydrate`. Add a null
implementation in `AbstractChangeDetector` and only override if
necessary for the specific change detector.

Update to #3248
2015-07-28 15:10:06 -07:00
Tim Blasi a9efc48e71 refactor(change_detect): Create & use `looseNotIdentical`
Create `looseNotIdentical => !looseIdentical`, which will save a lot of
unnecessary '!' characters in generated change detectors.

Update to https://github.com/angular/angular/issues/3248
2015-07-28 14:59:31 -07:00
vsavkin 8543c347a8 feat(core): provide an error context when an exception happens in an error handler 2015-07-28 14:22:15 -07:00
Rado Kirov 1d4502944c fix(query): the view should not be visible to @Query.
@ViewQuery is the correct way to query the view template.
2015-07-28 14:16:14 -07:00
Tim Blasi 2c9951273a style(dart): Run dartfmt v0.1.8+2 on all pure Dart code
Update formatting for all pure Dart code in the repo.
2015-07-28 12:44:03 -07:00
gdi2290 6fac901151 feat(http): call complete on request complete
closes #2635
2015-07-28 11:45:15 -07:00
Tim Blasi 03fc7fe8c2 refactor(change_detect): Make `ChangeDetectionUtil#uninitialized` a var
Previously, `uninitialized()` was a method, requiring a call as well as
two extra characters everywhere it was used.

Make this value a variable, saving the characters and avoiding the
method call to get its value.

This change also removes the export of `uninitialized` from
change_detect.ts, which is technically a breaking change, however
`uninitialized` is an implementation detail and nobody should be using
it in app logic. By convention, apps should not be importing from files
under `src/`.

Update to #3248.
2015-07-27 17:14:09 -07:00
Marc Laval eebd736cfe feat(build): initial SauceLabs setup
Closes #2347
2015-07-27 16:15:28 -07:00
Marc Fisher 448264be39 fix(core): fix type error in setElementProperty
Convert propertyValue to string when calling setElementAttribute.

Closes #3279
2015-07-27 16:05:10 -07:00
vsavkin 71bb4b3ee5 feat(change_detection): generate checkNoChanges only in dev mode 2015-07-27 15:50:19 -07:00
Misko Hevery a2bb81c406 Revert "fix(url_resolver): in Dart make package urls relative to AppRootUrl"
This reverts commit 469afda53e.
2015-07-27 14:15:02 -07:00
Jason Teplitz 7cbaf1076f refactor(Async): Unify TS and Dart PromiseCompleter naming
Also add explicit typing wherever we use PromiseCompleter
2015-07-27 10:28:07 -07:00
Pawel Kozlowski a8b57256c8 fix(class): allow class names with mixed case
Fixes #3001

BREAKING CHANGE:

View renderer used to take normalized CSS class names (ex. fooBar for foo-bar).
With this change a rendered implementation gets a calss name as specified in a
template, without any transformations / normalization. This change only affects
custom view renderers that should be updated accordingly.

Closes #3264
2015-07-27 16:46:42 +02:00
Misko Hevery 329a6e00dc chore(API): cleaned up top level imports (render) 2015-07-25 03:20:15 +00:00
Misko Hevery c83a3f3372 chore(docs): added more docs for core.ts 2015-07-25 03:20:12 +00:00
Tim Blasi 0906ee8a4e refactor(change_detect): Abstract name logic into NameRegistry
Create `NameRegistry`, responsible for understanding how names are
generated for change detector fields and variables.

Use `NameRegistry` for both JS Jit & Dart pre-generated detectors.
Making progress on #3248
2015-07-24 18:58:09 -07:00
Tim Blasi 23cd385f20 fix(dart/transform): Handle mixed lifecycle specs
Update the transformer to handle classes which both have a `lifecycle`
value and `implement` lifecycle interfaces.

Closes #3276
2015-07-24 18:02:04 -07:00
yjbanov 469afda53e fix(url_resolver): in Dart make package urls relative to AppRootUrl 2015-07-24 16:37:01 -07:00
vsavkin c2bbda02a1 feat(change_detection): provide error context for change detection errors 2015-07-24 15:45:26 -07:00
vsavkin e744409cb9 feat(exception_handler): print originalException and originalStack for all exceptions 2015-07-24 15:45:26 -07:00
Pawel Kozlowski 0a8b3816f7 style(lexer): idiomatic TypeScript
Closes #3228
2015-07-24 15:40:32 -07:00
Rado Kirov 2577f5eebf test(query): adds a test for query in the presense of projection.
Query uses only the logical structure of the application, so it is not
affected by projection, which only the rendering structure.

Closes #3278
2015-07-24 15:30:57 -07:00
Jacob MacDonald 5b5de6662f chore(transformer): Use class for reflection info instead of a map
closes https://github.com/angular/angular/issues/906
2015-07-24 13:12:57 -07:00
Hank Duan a8b75c3d41 feat(testability): hook zone into whenstable api with async support
closes(#428)
2015-07-24 12:46:12 -07:00
Pawel Kozlowski 345fa521dd fix(change_detection): convert interpolated null values to empty strings
Fixes #3007

Closes #3271
2015-07-24 18:05:06 +02:00
Pawel Kozlowski 16493e9769 refactor(integration_test): remove unused imports 2015-07-24 18:05:06 +02:00
Jason Teplitz 771c0170d9 feat(web-workers) Add WebWorker Renderer
Allows angular apps to be rendered from the webworker!
Closes #3052, #3053, and #3097
2015-07-23 18:29:10 -07:00
Tobias Bosch 1438922ffb fix(class): correctly clean up on destroy
Fixes #3249
Closes #3256
2015-07-23 17:13:33 -07:00
Sigmund Cherem fd46b49ea6 feat(transformers): directive aliases in Dart transformers (fix #1747) 2015-07-23 15:25:32 -07:00
Tobias Bosch 46502e4d61 fix(projection): allow more bound render elements than app elements.
Fixes #3236
Closes #3247
2015-07-23 15:05:46 -07:00
Tobias Bosch b44b06c2c9 fix(projection): allow to project to a non text node
We already had a test for this, but too low level that it did not catch this null value in `hasNativeShadowRoot`

Fixes #3230
Closes #3241
2015-07-23 14:29:15 -07:00
Tobias Bosch 5ec67ee2a7 fix(compiler): prevent race conditions
Previously, the compiler would detect cycles where there were none just because of other components that were compiled in parallel. Furthermore, the way ProtoView merging was triggered could result into early exits resulting in errors when trying to instantiate ProtoViews.

Fixes #3206
Closes #3211
2015-07-23 14:28:38 -07:00
vsavkin 70792c744d refactor(exception_handler): unified all exception handling
BREAKING CHANGE
    Previously it was possible to pass a custom error reporter to bootstrap, which was used only during the construction of Injector. This had limited utility, so this capability has been removed.
2015-07-23 11:22:04 -07:00
vsavkin fdf226ab69 feat(exception_handler): change ExceptionHandler to output context 2015-07-23 11:22:04 -07:00
Jacob MacDonald bd65b63c65 fix(transformer): Loggers now are per zone and each transform runs in its own zone 2015-07-23 09:36:04 -07:00
yjbanov 3531bb7118 feat(bootstrap): remove the need for explicit reflection setup in bootstrap code
BREAKING CHANGES:

Dart applications and TypeScript applications meant to transpile to Dart must now
import `package:angular2/bootstrap.dart` instead of `package:angular2/angular2.dart`
in their bootstrap code. `package:angular2/angular2.dart` no longer export the
bootstrap function. The transformer rewrites imports of `bootstrap.dart` and calls
to `bootstrap` to `bootstrap_static.dart` and `bootstrapStatic` respectively.
2015-07-22 17:02:32 -07:00
Matias Niemelä fdffcaba9b feat(router): use querystring params for top-level routes
Closes #3017
2015-07-22 14:40:55 -07:00
vsavkin 5a86f85936 feat(di): added context to runtime DI errors 2015-07-22 14:22:46 -07:00
Tim Blasi 8ad4ad57d1 feat(dart/transform): Populate `lifecycle` from lifecycle interfaces
When a `Directive` implements a lifecycle interface (e.g. `OnChange` or
`OnInit`), populate its `lifecycle` property if not already populated).

Closes #3181
2015-07-22 11:34:29 -07:00
Matias Niemelä 476988876c test(router): refactor integration tests to use TestComponentBuilder
Closes #3182
2015-07-21 20:40:42 -07:00
vsavkin 6f4a39c337 refactor(di): removed @Parent
BREAKING CHANGE
    The @Parent annotation has been removed. Use @Ancestor instead.
    @Parent was used to enforce a particular DOM structure (e.g., a pane component is a direct child of the tabs component).
    DI is not the right mechanism to do it. We should enforce it using schema instead.
2015-07-21 14:39:28 -07:00
Tobias Bosch a472eacc07 fix(content_projection): allow to project text nodes to a place without bindings
Fixes #3163
Closes #3179
2015-07-21 14:18:35 -07:00
Tobias Bosch 078475a082 refactor(compiler): speed up proto view merging
- Don't create intermediate merge results
- Only merge embedded ProtoViews that contain `<ng-content>` tags

Closes #3150
Closes #3177
2015-07-21 13:39:41 -07:00
Alex Eagle de18da2a0d feat(build): require parameter types
Fixes #2833
2015-07-21 06:20:13 -07:00
Tim Blasi b2a0be87e8 fix(change_detect): Sort `DirectiveMetadata` properties during processing
The Angular 2 render compiler can get out of sync between its transformer
execution and its runtime execution, leading to incorrect change detectors with
out-of-order property values. Stable sorting solves this problem (temporarily).
2015-07-20 17:08:02 -07:00
vsavkin 4c8ea12903 feat(pipes): changed .append to .extend
BREAKING CHANGE:
    Pipes.append has been renamed into Pipes.extend.
    Pipes.extend prepends pipe factories instead of appending them.
2015-07-20 15:36:42 -07:00
Alex Rickabaugh e94270946a feat(compiler): Support $baseUrl in HTML attributes when loading a template.
Angular fetches template HTML files outside of the browser's normal parsing flow. As a result, URLs in template files are interpreted relative to the root application, when the components defined by the template files are inserted into the DOM. This change enables a template author to prefix URLs with the string $baseUrl, which will be replaced with the relative base path of the template file.

So for an example template loaded from /component/foo/template.html:

<img src="$baseUrl/logo.png" />

becomes:

<img src="/component/foo/logo.png" />

Addresses #2384.
2015-07-20 15:26:00 -07:00
vsavkin 57496926ca fix(di): fixed dynamic component loading of components created in child injector 2015-07-17 16:18:19 -07:00
Brian Ford 011fab37af fix(router): improve error for missing base href
Closes #3096
2015-07-17 14:00:04 -07:00
Ted Sander 5cc84ed4bb feat(transformers): implement initializing deferred libraries
Implement deferred libraries to work with dependency injection and other
angular codegen. This is done by not initializing the library in the parent
ng_deps file when it is declared as deferred, rewriting the import and,
chaining a future that initializes the library in any files that are using
deferred libraries which need angular codegen.
2015-07-17 13:07:31 -07:00
vsavkin 13b1d85058 refactor(forms): removed iterableToList 2015-07-17 10:52:23 -07:00
Brian Ford c6409cb624 fix(router): throw when reserved characters used in route definition
Closes #3021
2015-07-17 10:51:23 -07:00
Tobias Bosch f42382db3b refactor(views): split `ViewManager/ViewContainerRef.createView` into 2 methods
BREAKING CHANGES:

`ViewManager.createView` / `ViewContainerRef.create` have been split into 2 methods:

- `createHostView` which takes dynamically created bindings
- `createEmbeddedView` which takes the newly introduced `TemplateRef`

The new type `TemplateRef` is the combination of a `ProtoViewRef` and and `ElementRef`
from the same place. Use `TemplateRef` when working with embedded views in
`ng-if`, `ng-for`, ... instead of `ProtoViewRef`.

Also, `ProtoViewRef` is no more injectable, but `TemplateRef` is.

First part of #1989 to clean up manual content projection.
Closes #3114
2015-07-17 10:40:32 -07:00
vsavkin 5b597de18c fix(forms): default the initial value of Control to null 2015-07-16 18:34:03 -07:00
Brian Ford 4d28167bc0 feat(router): add interfaces for route definitions in RouteConfig
Closes #2261
2015-07-16 16:36:22 -07:00
Tobias Bosch 61c73576c8 fix(renderer): handle empty fragments correctly
Closes #3100
2015-07-16 16:18:58 -07:00
Tobias Bosch 116b64de25 fix(view_manager): allow to create host views even if there is an embedded view at the same place. 2015-07-16 16:18:43 -07:00
Pawel Kozlowski b785503543 refactor(ProtoViewBuilder): improve error message for dangling bindings
Closes #3066
2015-07-16 16:16:49 -07:00
Ted Sander c701664e07 chore(transformers): remove reflector parameter from initReflector signature
Remove reflector parameter from initReflector method to simplify ng_deps for reflection
initialization. It wasn't used and was added for testability, but wasn't used. This
keeps the interface simplier.
2015-07-16 14:11:27 -07:00
Tim Blasi f1e8176995 fix(change_detect): Handle '$' in change detector strings
In Dart, '$' indicates the beginning of an interpolation.
- Escapes '$' in strings when generating change detector classes.
- Adds a unit test to cover this case.
2015-07-16 13:01:53 -07:00
Tobias Bosch 5654f2f4e2 test(dom_renderer): test that properties on the root element can be changed.
Closes #3013
Closes #3085
2015-07-16 10:39:32 -07:00
vsavkin b1231593b6 fix(forms): do not reset the value of the input when it came from the view 2015-07-16 10:00:32 -07:00
Tobias Bosch b1df54501a feat(compiler): attach components and project light dom during compilation.
Closes #2529

BREAKING CHANGES:
- shadow dom emulation no longer
  supports the `<content>` tag. Use the new `<ng-content>` instead
  (works with all shadow dom strategies).
- removed `DomRenderer.setViewRootNodes` and `AppViewManager.getComponentView`
  -> use `DomRenderer.getNativeElementSync(elementRef)` and change shadow dom directly
- the `Renderer` interface has changed:
  * `createView` now also has to support sub views
  * the notion of a container has been removed. Instead, the renderer has
    to implement methods to attach views next to elements or other views.
  * a RenderView now contains multiple RenderFragments. Fragments
    are used to move DOM nodes around.

Internal changes / design changes:
- Introduce notion of view fragments on render side
- DomProtoViews and DomViews on render side are merged,
  AppProtoViews are not merged, AppViews are partially merged
  (they share arrays with the other merged AppViews but we keep
  individual AppView instances for now).
- DomProtoViews always have a `<template>` element as root
  * needed for storing subviews
  * we have less chunks of DOM to clone now
- remove fake ElementBinder / Bound element for root text bindings
  and model them explicitly. This removes a lot of special cases we had!
- AppView shares data with nested component views
- some methods in AppViewManager (create, hydrate, dehydrate) are iterative now
  * now possible as we have all child AppViews / ElementRefs already in an array!
2015-07-15 20:23:27 -07:00
vsavkin d449ea5ca4 feat(change_detection): added support for ObservableList from package:observe 2015-07-15 17:06:42 -07:00
vsavkin 7879761a41 fix(element_injector): inject the containing change detector ref to directives 2015-07-15 17:06:42 -07:00
Jeff Cross 903ff9047f feat(core): add ability to reflect DOM properties as attributes
By binding the token `DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES` provided by 
the dom_renderer module to `true` in the root injector (i.e. bootstrap()), 
all elements whose properties are set by angular will be reflected as 
attributes with the prefix "ng-reflect-".

Fixes #2910
2015-07-15 13:59:44 -07:00
Brian Ford 8bdca5c03e fix(router): improve error messages for routes with no config
Closes #2323
2015-07-15 10:28:25 -07:00
Caitlin Potter 81abc39929 feat(http): add support for JSONP requests
Closes #2905
Closes #2818
2015-07-14 21:31:05 -04:00
vsavkin 7531b48d02 fix(di): instatiate services lazily 2015-07-14 17:10:30 -07:00
Misko Hevery b73ba68215 refactor(LifecycleEvent): change from onInit to Lifecycle.onInit
BREAKING CHANGE

Closes #2928
2015-07-14 16:51:44 -07:00
Jacob MacDonald e988f59c08 fix(html_adapter): Implement hasAttribute and getAttribute.
Fixes the template compiler when running on the server.
2015-07-14 14:48:00 -07:00
Matias Niemelä 5677bf73ca feat(router): introduce matrix params
Closes #2774
Closes #2989
2015-07-13 17:15:13 -07:00
vsavkin 04baa46efe fix(di): removed default visibility
BREAKING CHANGE:
    Directives will use the Unbounded visibility by default, whereas before the change they used Self
2015-07-13 16:00:07 -07:00
Jacob MacDonald 4bdc91892a chore(transformer): add a test that generated change detectors dont call notifyOnBinding for template variables 2015-07-13 15:09:06 -07:00
Tobias Bosch b3a763a718 fix(compiler): keep `DOM.hasProperty` in sync between browser and transformer.
Right now, we always return true until
we have property schema support (#2014).

Fixes #2984
Closes #2981
2015-07-13 15:09:06 -07:00
Rado Kirov 7ee6963f5d feat(query): initial implementation of view query.
ViewQuery is a new API that allows a component to query its view.

Closes #1935
2015-07-13 14:44:55 -07:00
Jacob MacDonald cf103de4a7 fix(transformer): Event getters now use property name not event name 2015-07-13 10:42:09 -07:00
Brian Ford a9a552c112 feat(router): lifecycle hooks
Closes #2640
2015-07-13 09:12:15 -07:00
Martin Probst 3bf8c18c56 chore: run clang-format on code base.
This fixes several minor indentation issues (instanceof precendence,
type declaration specificity, template string length calculation).

This should also fix some flip-flop situations with template strings.
2015-07-12 18:50:52 +02:00
yjbanov 0e28297e68 feat(zone): add "on event done" zone hook 2015-07-10 15:45:52 -07:00
Jeff Cross 1eebceab27 feat(pipes): add static append method to Pipes
This change allows creation of a new Pipes binding with new pipes appended
to pipes of an inherited Pipes instance.

Closes #2901
2015-07-10 15:42:57 -07:00
Jeff Cross 9a70f84e60 refactor(pipes): rename PipeRegistry to Pipes
BREAKING CHANGE:
    This change renames all instances of PipeRegistry to Pipes.
    As part of this change, the former "defaultPipes" export is
    now a Pipes instance, instead of a map. The map that was previously
    called "defaultPipes" no longer exists, but may be accessed via
    defaultPipes.config.
2015-07-10 15:42:56 -07:00
Jeff Cross 8b3efdf229 chore(pipes): rename pipe_registry.ts -> pipes.ts
This is its own commit so that tools have an easier time of preserving
history of the file, by keeping the diff between pipes.ts and
pipe_registry.ts minimal.

Also moved pipe_registry_spec.ts
2015-07-10 15:42:56 -07:00
Sigmund Cherem 62589293aa fix(transformer): fix 'pub build' in examples 2015-07-10 15:08:48 -07:00
Rado Kirov 749d043258 fix(css_shim): fixes multiple uses of polyfill-unscoped-rule. 2015-07-10 12:40:57 -07:00
vsavkin 0ed5dd0d7b fix(di): hostInjector and viewInjector support nested arrays 2015-07-09 15:03:38 -07:00
Pouria Alimirzaei b716046b97 feat(pipes): add date pipe
Closes #2877
2015-07-09 15:00:14 -07:00
Pouria Alimirzaei 3143d188ae feat(pipes): add number (decimal, percent, currency) pipes 2015-07-09 14:59:57 -07:00
vsavkin b54e7214f0 chore: removed angular2.api.ts
BREACKING CHANGE:

We export InjectMetadata instead of InjectAnnotation
2015-07-09 13:54:07 -07:00