93 Commits

Author SHA1 Message Date
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
Alex Eagle
643c71740e chore(build): enable type-checking for TypeScript ES6 emit.
This requires delicate handling of type definitions which collide, because
we use TypeScript-provided lib.d.ts for --target=es5 and lib.es6.d.ts for
--target=es6.
We need to include our polyfill typings only in the --target=es5 case,
and the usages have to be consistent with lib.es6.d.ts.
Also starting with this change we now typecheck additional modules,
so this fixes a bunch of wrong typings which were never checked before.

Fixes #3178
2015-08-06 16:57:52 -07:00
Pawel Kozlowski
6eaa09ac20 refactor(injector): remove unused consts
Closes #3454
2015-08-04 08:40:27 +02:00
Naomi Black
209aefee57 docs(fix-docgen): Fix docgen issues with some recent updates to core 2015-08-03 14:27:02 -07: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
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
vsavkin
c2bbda02a1 feat(change_detection): provide error context for change detection errors 2015-07-24 15:45:26 -07:00
Pascal Precht
bc21aa0124 refactor(di/injector): fixes typo in InjectorStrategy interface
Closes #3269
2015-07-24 15:36:27 -07:00
Alex Eagle
19d8b221b4 fix(typings): test our .d.ts with --noImplicitAny
This matches how DefinitelyTyped tests it, so we are
one step closer to publishing the same file we generate.

See #3195
2015-07-24 11:24:44 -07:00
vsavkin
5a86f85936 feat(di): added context to runtime DI errors 2015-07-22 14:22:46 -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
Alex Eagle
de18da2a0d feat(build): require parameter types
Fixes #2833
2015-07-21 06:20:13 -07:00
vsavkin
2f08ed8d3e fix(di): fixed types 2015-07-17 13:04:34 -07:00
vsavkin
2147ce45c2 fix(di): do not rely on the fact that types are canonicalized 2015-07-16 15:19:18 -07:00
vsavkin
7531b48d02 fix(di): instatiate services lazily 2015-07-14 17:10:30 -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
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
Peter Bacon Darwin
2e4a2a0e5a chore(doc-gen): remove unnecessary @public and @exportedAs tags 2015-07-11 07:21:46 +01:00
vsavkin
a6210466c7 fix(di): do not use exceptions to detect if reflection is enabled 2015-07-10 10:50:03 -07:00
vsavkin
0ed5dd0d7b fix(di): hostInjector and viewInjector support nested arrays 2015-07-09 15:03:38 -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
vsavkin
569766fa8b refactor(di): added support for custom dep providers 2015-07-07 08:27:54 -07:00
vsavkin
d1393b0581 fix(di): injecting null causes a cyclic dependency 2015-07-01 17:08:45 -07:00
vsavkin
f0e962c55e feat(di): removed app injector
BREAKING CHANGE:

THe appInjector property has been removed. Instead use viewInjector or hostInjector.
2015-07-01 13:33:43 -07:00
Pawel Kozlowski
530e742628 refactor(injector): remove unused function
Closes #2815
2015-07-01 15:27:23 +02:00
Alex Eagle
44891996b5 fix(build): add missing return types now enforced by linter 2015-06-29 15:31:41 -07:00
vsavkin
eb0fd7967c feat(di): changed InstantiationError to print the original stack 2015-06-29 11:16:12 -07:00
vsavkin
22d3943831 refactor(di): unified di injector and core injector
BREAKING CHANGES:

* InjectAsync and InjectLazy have been removed
* toAsyncFactory has been removed
2015-06-26 15:59:18 -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
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
Victor Berchet
ffd1ac425e style(DI): idiomatic TS 2015-06-17 11:22:16 +02:00
Victor Berchet
cdfb635737 refactor(facade): refactor type check function - is*() 2015-06-16 19:27:34 +02: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
Misko Hevery
2ccc65d7fd fix: Improve error message on missing dependency 2015-06-10 16:40:38 -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
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
c571b2693e feat(OpaqueToken): now a const constructor
BREAKING CHANGE:

now a `const` constructor
2015-06-01 16:24:36 -07:00
vsavkin
d523613329 test(di): added a test verifying hierarchical injection 2015-05-29 15:52:46 -07:00
elimach
a80921b45d fix(binding): unbalanced curly brackets in documentation 2015-05-29 17:54:51 +02:00
Victor Berchet
ec2d8cc2c8 feat(binding): throw on binding to a blank alias
fixes #2068
2015-05-28 22:37:29 +02:00
Martin Probst
2c25055828 chore: reformat the code base using the clang-format 1.0.15. 2015-05-27 15:28:22 -07:00
vsavkin
df59e969cf chore(di): moved tests to typescript 2015-05-22 17:32:21 -07:00
Martin Probst
15f1eb28a2 fix(deps): Update clang-format to 1.0.14. 2015-05-22 09:39: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
Tobias Bosch
e61d82b9be refactor(core): ts’ify core 2015-05-20 16:30:41 -07:00