Commit Graph

1169 Commits

Author SHA1 Message Date
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 608017776e fix(package.json): add `reflect-metadata` to package.json
Fixes #2170
2015-05-27 10:32:38 -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
Ian Riley 8609543ad0 refactor (test/facade): Ts'ify test/facade
Translate AtScript in test/facade to TypeScript
2015-05-27 08:10:11 +02:00
cexbrayat f83f1ee0ce fix(example): unused event 2015-05-27 08:09:55 +02:00
gdi2290 1db6870a81 docs(ng_for.ts): For => NgFor 2015-05-27 08:09:42 +02:00
gdi2290 c19c69f336 refactor(forms): remove self closing wrap <label>s
html5 doesn't have self closing tags
breaks `stringifyElement` from
https://github.com/angular/angular/pull/2106

also an error with submit form and wrap with <label>s
2015-05-27 08:09:26 +02:00
Hank Duan b390f441a1 feat(benchpress): Add extension for ff metrics reporting
Closes #1976
2015-05-26 17:30:41 -07: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
Ian Riley ef3e12e803 refactor (test/directives): ts'ify test/directives
Translate all of the AtScript code in .../test/directives to TypeScript.

Closes #2167
2015-05-26 16:51:38 -07:00
Kevin Moore 5fe88d63ef chore: support the latest release of Dart logging package 2015-05-26 13:51:54 -07:00
Jeremy Elbourn 0f3a8f369a chore(material): migrate most components to TypeScript. 2015-05-26 13:35:44 -07:00
Victor Berchet 26d5d17ebe style: fix clang-format glitches 2015-05-26 21:00:44 +02:00
Victor Berchet bb7ffce7eb test(ShadowCss): add tests for keyframe rules 2015-05-26 19:42:17 +02:00
Victor Berchet 551586ced0 feat(RegExpWrapper): implement a test method 2015-05-26 19:42:17 +02:00
Tobias Bosch 1dc8ba6920 refactor(render): ts’ify tests 2015-05-26 09:38:26 -07: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
Naomi Black 5a52c0b71d docs(di): fix missing export for dgeni docgen 2015-05-22 21:47:34 -07:00
gdi2290 662da0d728 feat(render): re-export render and export `DirectiveResolver`
Closes #2026
2015-05-22 17:38:00 -07:00
vsavkin df59e969cf chore(di): moved tests to typescript 2015-05-22 17:32:21 -07:00
vsavkin d27e5512c0 chore(reflection): tsfy tests 2015-05-22 17:03:40 -07:00
yjbanov d48fae3566 fix(core): resurrect OnChange interface 2015-05-22 16:48:00 -07:00
vsavkin 3525c9c074 chore(forms): moved tests/forms to typescript 2015-05-22 14:44:57 -07:00
Martin Probst 15f1eb28a2 fix(deps): Update clang-format to 1.0.14. 2015-05-22 09:39:15 -07:00
Victor Berchet ed8364741b refactor(form example): TSify 2015-05-22 17:45:57 +02:00
Victor Berchet 6c1cb089b5 refactor(examples): ts’ify
relates to #2008
2015-05-22 16:48:29 +02: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
Victor Berchet 9988471fb8 test(fakeAsync): renable a test blocked on jasmine 2.3.3 2015-05-22 15:36:12 +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 588fbfd848 fix(test): use a not expandable CSS rule in ShadowCSS spec (Firefox)
Closes #2061
2015-05-22 13:32:24 +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 9802debf71 fix(test): native shadow DOM is required (IE11, Firefox) 2015-05-22 13:30:45 +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
gdi2290 1f20ef9787 feat(router.js): export routerDirectives 2015-05-22 12:45:26 +02:00
Adam Bradley 1ad6558229 fix(examples): update form example to use NgIf 2015-05-22 12:32:13 +02:00
gdi2290 d61a0dfa22 test(ObservablePipe): onDestroy shouldn't throw 2015-05-22 12:31:46 +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
yjbanov c5996529c3 chore(expressions): add explicit test for map vs property access 2015-05-21 14:41:26 -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
Tobias Bosch 73d15edef5 chore(build): add tsconfig.json to modules/angular2
This allows to use `tsc` directly on Angular2, e.g.
```
./node_modules/.bin/tsc -w -p modules/angular2/
```
2015-05-19 15:12:58 -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
Peter Bacon Darwin 3571450b42 docs(directives.js): remove invalid asterisk
This character was breaking the doc-gen
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
vsavkin 155b1e2b35 feat(pipe): reexported pipes to genereate docs 2015-05-18 18:24:26 -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
Brian Ford 6b02cb9b44 test(router): rename helpers in test 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
Tim Blasi 534cbb4bf5 refactor(benchmarks): Update compile benchmarks
Update the compile benchmark to allow the Dart transformer to properly
generate the getters, setters, & methods needed.

This also improves the method of duplicating the source templates,
further decreasing runtime from ~5s to ~2s.
2015-05-18 14:34:36 -07:00
Jeremy Elbourn 8d6943227d chore(material): add e2e smoke tests for a few more components.
Closes #1884
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 842459aa46 doc: fix & sync with latest updates 2015-05-18 23:11:45 +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
Michael Goderbauer 0e04467b8a docs(bench press): Added link to Chromedriver bug for reference
Closes #1923
2015-05-15 16:51:18 -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
Victor Berchet 909233f724 fix(ng1 benchmarks): revert *ng-if to ng-if 2015-05-13 11:56:50 +02:00
Victor Berchet 0e82970a29 fix(examples): prefix directives with Ng 2015-05-13 11:56:50 +02:00
Victor Berchet cdbb2473bb fix(benchmark): change If for NgIf 2015-05-13 11:56:50 +02:00
Victor Berchet c20060d259 fix(directives): fix import path 2015-05-13 11:56:50 +02:00
Rado Kirov 38926f7123 fix(benchmark): fixes ng-if ng-for renaming for templates. 2015-05-13 11:56:50 +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
vsavkin 032f8b7840 fix(test): fixed a test 2015-05-12 14:40:20 -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