Commit Graph

53 Commits

Author SHA1 Message Date
Victor Berchet bb9c7ae6e7 feat: RendererV2 integration (#14469) 2017-02-14 21:03:18 -08:00
Jason Aden 3ef73c2b19 feat(NgComponentOutlet): add NgModule support to NgComponentOutlet directive (#14088)
Allow NgComponentOutlet to dynamically load a module, then load a component from
that module. Useful for lazy loading code, then add the lazy loaded code to the
page using NgComponentOutlet.

Closes #14043
2017-01-25 17:41:08 -08:00
Miško Hevery d169c2434e feat(core): Add type information to injector.get() (#13785)
- Introduce `InjectionToken<T>` which is a parameterized and type-safe
  version of `OpaqueToken`.

DEPRECATION:
- `OpaqueToken` is now deprecated, use `InjectionToken<T>` instead.
- `Injector.get(token: any, notFoundValue?: any): any` is now deprecated
  use the same method which is now overloaded as
  `Injector.get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T): T;`.

Migration
- Replace `OpaqueToken` with `InjectionToken<?>` and parameterize it.
- Migrate your code to only use `Type<?>` or `InjectionToken<?>` as
  injection tokens. Using other tokens will not be supported in the
  future.

BREAKING CHANGE:
- Because `injector.get()` is now parameterize it is possible that code
  which used to work no longer type checks. Example would be if one
  injects `Foo` but configures it as `{provide: Foo, useClass: MockFoo}`.
  The injection instance will be that of `MockFoo` but the type will be
  `Foo` instead of `any` as in the past. This means that it was possible
  to call a method on `MockFoo` in the past which now will fail type
  check. See this example:

```
class Foo {}
class MockFoo extends Foo {
  setupMock();
}

var PROVIDERS = [
  {provide: Foo, useClass: MockFoo}
];

...

function myTest(injector: Injector) {
  var foo = injector.get(Foo);
  // This line used to work since `foo` used to be `any` before this
  // change, it will now be `Foo`, and `Foo` does not have `setUpMock()`.
  // The fix is to downcast: `injector.get(Foo) as MockFoo`.
  foo.setUpMock();
}
```

PR Close #13785
2017-01-17 15:34:54 -06:00
Marc Laval f364557629 fix(common): support numeric value as discrete cases for NgPlural (#13876)
PR Close #13876
2017-01-13 13:52:35 -06:00
Victor Berchet 9aeb8c5357 refactor(test): `<template>`/`<ng-container>`/*-directives
- remove outer `<div>` in tests,
- use `<ng-container>` instead of `<template>` where possible,
- use *... instead of template (tag or attr) where possible.

Fixes #13816
2017-01-09 19:33:38 -05:00
shlomiassaf 8578682dcf feat(NgComponentOutlet): add NgComponentOutlet directive
Add NgComponentOutlet directive that can be used to dynamically create
host views from a supplied component.

Closes #11168
Takes over PR #11235
2017-01-06 19:30:38 -05:00
Misko Hevery c0178de0e2 feat(NgTemplateOutlet): Make NgTemplateOutlet compatible with * syntax
BREAKING CHANGE:

- Deprecate `ngOutletContext`. Use `ngTemplateOutletContext` instead
2017-01-06 19:30:20 -05:00
Victor Berchet f88cd2f22e fix(Common): allow null/undefined values for `NgForTrackBy`
Reverts a breaking change introduced in 2.4.1 by #13420
fixes #13641
2017-01-05 11:18:34 -08:00
Dzmitry Shylovich fcd116fdc0 fix(common): throw an error if trackBy is not a function (#13420)
* fix(common): throw an error if trackBy is not a function

Closes #13388

* refactor(platform-browser): disable no-console rule in DomAdapter
2016-12-20 16:18:24 -08:00
Misko Hevery b4db73d0bf feat: ngIf now supports else; saves condition to local var
NgIf syntax has been extended to support else clause to display template
when the condition is false. In addition the condition value can now
be stored in local variable, for later reuse. This is especially useful
when used with the `async` pipe.

Example:

```
<div *ngIf="userObservable | async; else loading; let user">
  Hello {{user.last}}, {{user.first}}!
</div>
<template #loading>Waiting...</template>
```

closes #13061
closes #13297
2016-12-09 11:19:08 -08:00
Joao Dias 77ee27c59e refactor(): use const and let instead of var 2016-11-12 16:40:17 -08:00
Pawel Kozlowski f3793b5953 fix(NgClass): throw a descriptive error when CSS class is not a string (#12662)
Fixes #12586
2016-11-07 12:23:31 -08:00
Tobias Bosch d8f23f4b7f fix(common): `NgSwitch` - don’t create the default case if another case matches (#12726)
This also simplifies the implementation of `NgSwitch`.

Closes #11297
Closes #9420
2016-11-07 12:22:36 -08:00
Tobias Bosch 74ede9aa9b refactor(core): don’t store view factory in `TemplateRef`
Instead, generate `createEmbeddedView`.
2016-11-02 17:06:27 -07:00
Victor Berchet fdf4309b50 perf(common): optimize NgSwitch default case
relates to #11297
2016-10-12 17:11:46 -07:00
Alex Eagle 41c8c30973 chore(lint): remove unused imports (#11923)
This was done automatically by tslint, which can now fix issues it finds.
The fixer is still pending in PR https://github.com/palantir/tslint/pull/1568
Also I have a local bugfix for https://github.com/palantir/tslint/issues/1569
which causes too many imports to be deleted.
2016-09-27 17:12:25 -07:00
Victor Berchet 82f30e09f0 refactor(common): cleanup directive tests 2016-09-09 14:30:18 -07:00
Victor Berchet f5d44a42c9 refactor(NgClass): cleanup, readability (#11467) 2016-09-09 12:03:51 -07:00
Victor Berchet 1df69cb4d2 fix(DomSchemaRegistry): detect invalid elements 2016-08-30 21:32:03 -07:00
Igor Minar 3c2b2ff332 test: fix existing tests by removing usage of obsolete stuff like component level directives, AsyncCompleter and TestComponentBuilder 2016-08-23 09:59:00 -07:00
Igor Minar 73a9ee4a05 Remove component resolver (#10858)
* refactor(core): remove deprecated ComponentResolver

BREAKING CHANGE: deprecated ComponentResolver was removed

Please follow deprecation instruction and migrate your code to use ComponentFactoryResolver.

* refactor(common): remove deprecated NgSwitchWhen directive

BREAKING CHANGE: previously deprecated NgSwitchWhen directive was removed, use NgSwitchCase instead
2016-08-16 16:48:32 -07:00
mgiambalvo 231ed69507 refactor(common): Remove uses of deprecated TestComponentBuilder. (#10754)
* ng_class_spec

* Working through ng_for_spec.

* Finishing up ng_for_spec.

* Finish the rest of the specs.

* Convert pipes tests.
2016-08-15 13:52:57 -07:00
Jason Choi 99989f5d3f chore(facade): remove most facade/async functions 2016-08-05 12:26:28 -07:00
Victor Berchet 0ca05eee45 feat(ExpressionParser): add support for `this` 2016-08-05 09:45:13 -07:00
Victor Berchet 26c9e1dc70 refactor(NgFor spec): code cleanup 2016-08-05 09:45:13 -07:00
Pawel Kozlowski 797cb5ae7b refactor(NgStyleSpec): simplify NgStyle tests (#10519) 2016-08-05 09:28:08 -07:00
Pawel Kozlowski 8b18ef4ba2 feat(NgStyle): add support for the style.unit notation (#10496)
Closes #10326
2016-08-04 11:00:43 -07:00
Victor Berchet 106db0aba8 refactor: IS_DART === false 2016-08-01 11:34:51 -07:00
Victor Berchet b652a7fc9f chore: remove obsolete files (#10240) 2016-07-22 16:18:31 -07:00
Jason Choi 64fc4648b7 fix(testing): correctly import NgMatchers (#10077)
Some test cases incorrectly rely on the side effect of other test cases
importing `NgMatchers`. This commit fixes this by making `expect` in
`core/testing_internal` properly typed.
2016-07-22 09:20:51 -07:00
Victor Berchet 00aa7a76b6 chore(tests): enable lint, make it green. (#10224) 2016-07-21 17:12:00 -07:00
Victor Berchet 3f08efa35d fix(KeyValueDiffer): check for changes
fixes #9115
2016-07-18 11:30:07 -07:00
Victor Berchet 93d0a01d3d refactor: code cleanup 2016-07-11 16:22:23 -07:00
Julie Ralph 9af2d8b810 fix(testing): remove deprecated testing APIs (#9923)
See https://github.com/angular/angular/blob/master/CHANGELOG.md for
prior deprecation and how to update.
2016-07-11 16:04:32 -07:00
Victor Berchet eacc9e6541 refactor: misc cleanup 2016-07-08 10:34:22 -07:00
Victor Berchet b7e69bc1a1 fix(NgPlural): expression inside cases (#9883)
fixes #9868
2016-07-07 14:47:06 -07:00
Julie Ralph 1143b0389a fix(core/testing): move ComponentFixture to core (#9386)
BREAKING CHANGE:

`ComponentFixture` will be moving out of `@angular/compiler/testing` to `@angular/core/testing` in
this release. For now, it is deprecated from `@angular/compiler/testing`.
2016-06-24 12:41:49 -07:00
Julie Ralph 3d8eb8cbca fix(platform-browser/testing): clean up public api for platform-browser/testing (#9519)
Mostly, removing things that were never intended to be exported publicy.

BREAKING CHANGE:

The following are no longer publicly exported APIs. They were intended as internal
utilities and you should use your own util:

```
browserDetection,
dispatchEvent,
el,
normalizeCSS,
stringifyElement,
expect (and custom matchers for Jasmine)
```
2016-06-23 16:42:25 -07:00
Victor Berchet fed1672a43 refactor(i18n): I18nPipe uses NgLocalization (#9313)
and some refactoring
2016-06-23 11:44:05 -07:00
ScottSWu ae75e3640a chore(lint): Added license headers to most TypeScript files
Relates to #9380
2016-06-23 09:47:54 -07:00
Victor Berchet 721f53f0d6 feat(I18N Expander): do not add extra `<ul>` & `<li>` around ICU messages (#9283)
fixes #9072
2016-06-17 11:38:24 -07:00
Victor Berchet 1f6fd3c8fc refactor: add types (#9148) 2016-06-11 21:23:37 -07:00
Misko Hevery 9c0031f7a5 fix: broken build due to bad noImplicitAny merge 2016-06-10 10:35:36 -07:00
Shlomi Assaf 164a091c71 feat(NgTemplateOutlet): add context to NgTemplateOutlet
Closes #9042
2016-06-10 10:25:44 -07:00
Rob Wormald e1fcab777c fix(ngSwitch): use switchCase instead of switchWhen (#9076) 2016-06-09 22:52:30 -07:00
Alex Eagle f39c9c9e75 style(lint): re-format modules/@angular 2016-06-09 17:00:15 -07:00
Victor Berchet 7ce0fc7d47 refactor: add types (#9116) 2016-06-09 11:04:15 -07:00
ScottSWu 86fbd50c3d refactor(TypeScript): Add noImplicitAny
We automatically insert explicit 'any's where needed. These need to be
addressed as in #9100.

Fixes #4924
2016-06-08 16:20:50 -07:00
Victor Berchet a6ad61d83e refactor: change provide(...) for {provide: ...}
- provide() is deprecated,
- {} syntax is required by the offline compiler
2016-06-03 15:03:49 -07:00
Victor Berchet 75e6dfb9ab fix(browser): platform code cleanup 2016-05-23 17:57:28 -07:00