Commit Graph

935 Commits

Author SHA1 Message Date
69e4b62809 docs(onDestroy): fix broken backticks
Closes #5089
2015-11-04 17:51:32 +00:00
5948abab7a feat(core): add support for ambient directives
Ambient directives can be configured when bootstraping an application.
Ambient directives can be used in every component of the application without
needing to explicitly list them.
2015-11-03 07:54:29 -08:00
c814dfbfa5 fix: remove internal usages of deprecated overrideOnTurnDone
Closes #5079
2015-11-02 23:46:20 +00:00
8dc079eee5 docs: add @Input/@Output to deprecation messages 2015-11-02 14:48:23 -08:00
c4129071ef docs(metadata): provide deprecation messages 2015-11-02 14:48:22 -08:00
1c322f13e5 feat(forms): update FormBuilder to support async validations
Closes #5020
2015-11-02 18:03:03 +00:00
31c12af81f feat(forms): add support for adding async validators via template
Example:

@Directive({
  selector: '[uniq-login-validator]',
  providers: [provide(NG_ASYNC_VALIDATORS, {useExisting: UniqLoginValidator, multi: true})]
})
class UniqLoginValidator implements Validator {
  validate(c) { return someFunctionReturningPromiseOrObservable(); }
}
2015-11-02 18:03:03 +00:00
cf449ddaa9 feat(forms): implements a combinator for composing async validators 2015-11-02 18:03:02 +00:00
53bd6e1642 feat(facade): add ObservableWrapper.fromPromise 2015-11-02 18:03:02 +00:00
d8775e0e1f fix(shadow_css): strip comments and fix logic for parsing rules.
Closes #5037
Closes #5011
2015-10-30 16:28:26 -07:00
45b33c5a90 perf(dart/transform): Restrict visibility/mutability of codegen
For exported, generated templates, declare with `final` so `dart2js`
knows they will never be reassigned.

For non-exported, generated change detector classes, prefix the
classname with `_` to mark them as internal.

Closes #5009
2015-10-30 17:49:06 +00:00
fa44da16c8 refactor(linker): Expose ViewResolver to public api
Fixes https://github.com/angular/angular/issues/4780

Closes #4789
2015-10-29 21:21:04 -07:00
56e736439b fix(analyzer): fix dart analyzer errors
Closes #4992
2015-10-30 01:10:36 +00:00
9d58f46ea5 fix(forms): update compose to handle null validators 2015-10-30 01:10:36 +00:00
bb2b961f93 feat(forms): add support for async validations 2015-10-30 01:10:36 +00:00
39626a944d fix(ng-content): wildcard ng-content has to go last.
This was the case before the new compiler landed and should be preserved. 

Related to #4598
Closes #5016
2015-10-29 16:51:16 -07:00
d1b54d6807 fix(core): Add an error state for ChangeDetectors that is set when bindings or lifecycle events throw exceptions and prevents further detection.
- Changes the `alreadyChecked` flag of AbstractChangeDetector to a new `state` flag.
- Changes all checks of alreadyChecked to check that the state is NeverChecked.
- Set state to Errored if an error is thrown during detection.
- Skip change detection for a detector and its children when the state is Errored.
- Add a test to validate this fixes issue #4323.

Closes #4953
2015-10-29 23:11:02 +00:00
389ed2d941 refactor(async): fix ObservableWrapper.isObservable
Makes ObservableWrapper and AsyncPipe work with Observable, Subject, and EventEmitter
2015-10-29 23:06:16 +00:00
0378e55fab chore(package): update RxJS version 2015-10-29 23:06:16 +00:00
ca3986f31d refactor(async): refactor EventEmitter
Refactor EventEmitter and Async Facade to match ES7 Observable semantics, properly use RxJS typedefs, make EventEmitter inherit from RxJS Subject. Closes #4149.

BREAKING CHANGE:
- consumers of EventEmitter no longer need to call .toRx()
- EventEmitter is now generic and requires a type - e.g. `EventEmitter<string>`
- EventEmitter and Observable now use the `.subscribe(generatorOrNext, error, complete)` method instead of `.observer(generator)`
- ObservableWrapper uses `callNext/callError/callComplete` instead of `callNext/callThrow/callReturn`
2015-10-29 23:06:16 +00:00
72e65d6797 refactor(core): Move LifeCycle functionality into ApplicationRef.
BREAKING CHANGE:

Before: constructor(@Inject(LifeCycle) lifecycle) { lifecycle.tick(); }
After: constructor(@Inject(ApplicationRef) appRef) { appRef.tick(); }

Closes #5008
2015-10-29 22:28:30 +00:00
ef23fe66a0 docs(forms): Document the rest of the forms module.
Closes #4437
2015-10-29 22:26:07 +00:00
993b3d62de refactor(compiler): don’t rely on external css parser
We used to use different external css parsers,
depending on the `DomAdapter`. This lead to
inconsistent behavior and environment specific errors.

Closes #5006
Closes #4993
2015-10-29 15:09:39 -07:00
28be0a59cf docs(application_common): fixes typo and improves docs for bootstrap
Closes #4312
2015-10-29 04:04:10 +00:00
1de2d29f96 typo(directives): Fixed the mistake of leading number
The leading number with a dot and space in the Markdown will be compiled to `ol > li`.

The `4 and 6. ` in the docs mistakenly add a new line before the `6. ` cause a misunderstand by the markdown engine.

Closes #4664
2015-10-29 03:39:44 +00:00
0abd218eed docs(core): Document NgFor.
Closes #4533
2015-10-29 03:26:42 +00:00
7f806f7687 refactor: remove useless imports
Closes #4426
2015-10-29 02:49:08 +00:00
7677dc976e refactor(Pipes): integrate review feedback
Closes #4947
2015-10-29 00:50:52 +00:00
2f1f83a186 fix(Pipes): mark date & slice as non-pure 2015-10-29 00:50:52 +00:00
7ba426c3e6 fix(Pipe): pure is an optional argument 2015-10-29 00:50:52 +00:00
fc016b59dc fix(JsonPipe): marks json pipe as not pure Marked json pipe as not pure so that it runs all the time, reflecting changes on the object.
Closes #4821
2015-10-29 00:50:51 +00:00
e1337dc325 cleanup(forms): minor cleanup
Closes #4778
2015-10-29 00:02:01 +00:00
534db7fe2b cleanup(forms): marks abstract classes as abstract 2015-10-29 00:02:01 +00:00
547e011abe feat(forms): add support for Validator
Currently, the only way for a directive to export a validator is by providing a function. This makes it ackward to write validators that depend on directive inputs. In addition to supporting functions as validators, classes implementing the Validator interface are supported too.
2015-10-29 00:02:01 +00:00
098201d0b8 fix(lint): enforce that module-private members have @internal.
This is needed to prevent leaking internal APIs to users via our published .d.ts typings.
Fixes #4645

Closes #4989
2015-10-28 22:14:48 +00:00
44188b9072 chore(typings): mark underscore-prefix members @internal
I still haven't made a tslint check for this, so new occurrences leaked in.
See https://github.com/angular/angular/issues/4645

Closes #4986
2015-10-28 21:27:34 +00:00
e3c9397717 docs(element_injector): fix comment for ElementInjectorDynamicStrategy
Closes #4414
2015-10-28 20:29:05 +00:00
5c48236f61 fix(lang): avoid infinite loop when calling assert()
The current code doesn't function properly:
- assert are never activated
- even if activated would result in infinite loop

Since the code is broken and blocks other use-cases
this commit turns assert into noop. A proper solution
for asserts will be part of #2830

Fixes #4981

Closes #4983
2015-10-28 19:12:28 +00:00
c90e1920f5 chore(tslint): disallow variable names that look like keywords.
We've had issues such as the one I documented: https://github.com/Microsoft/TypeScript/issues/5187
This tslint check prevents this happening again.
This change also updates to the newest tslint which gets typings from npm.

Closes #4970
2015-10-28 18:31:21 +00:00
25ddd8718d feat(forms): Export NumberValueAccessor
Export `NumberValueAccessor` from `forms/directives.ts`
2015-10-28 10:36:18 -07:00
3ed9796425 docs(SlicePipe): fix ng-for example
Closes #4975
2015-10-28 15:54:47 +00:00
c91fc49d01 test(dart/transform): Update tests for new codegen
Update unit tests for `bind_generator` responsibility move.
2015-10-28 08:18:56 -07:00
f9963d3d21 refactor(di): minor cleanup 2015-10-28 07:32:40 -07:00
6514b8ced0 fix(di): allow dependencies as flat array 2015-10-28 07:32:40 -07:00
c02f2bdab0 chore: adjust formatting to new clang-format.
- fixes wrapping for object literal keys called `template`.
- spacing in destructuring expressions.
- changes to keep trailing return types of functions closer to their
  function declaration.
- better formatting of string literals.

Closes #4828
2015-10-28 11:19:10 +01:00
edfa35b11d fix(facades): reduce node count by 1 in assertionsEnabled 2015-10-27 23:14:52 -07:00
5fc28e65ef docs(provider): fix formatting
Closes #4957
2015-10-28 01:42:10 +00:00
1316c3e391 fix(ChangeDetector): support for NaN
Closes #4853
2015-10-28 00:44:06 +00:00
758062807a feat(forms): support adding validators to ControlGroup via template
Closes #4954
2015-10-28 00:13:20 +00:00
f98faf0702 refactor(forms): make Validators.group and Validators.array private 2015-10-28 00:13:20 +00:00