Commit Graph

130 Commits

Author SHA1 Message Date
Alex Eagle f39c9c9e75 style(lint): re-format modules/@angular 2016-06-09 17:00:15 -07:00
Pawel Kozlowski 0c9e8dbf60 docs(linker): document the injector argument as mandatory (#9098)
Fixes #8600
2016-06-09 16:03:42 -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
Miško Hevery 87d824e1b4 fix: add typescript test for our typings (#9096)
* Revert "fix(d.ts): enable angular2 compilation with TS flag --strictNullChecks (#8902)"

This reverts commit 7e352a27f7.

* test: add typescript test for our typings
2016-06-08 16:06:23 -07:00
Matias Niemelä 36d25f2a07 feat(animations): support styling of the default animation state
It is now possible to set a fallback state that will apply its
styling when the destination state is not detected.

```ts
state("*", style({ ... }))
```

Closes #9013
2016-06-07 12:59:33 -07:00
Tobias Bosch c3d2459a4e fix(query): set fixed `@ViewChild` / `@ContentChild` right after the view is created
This is needed to have a true replacement of the previous
`DynamicComponentLoader.loadNextToLocation`, so that components
can be loaded into the view before change detection runs.

Closes #9040
2016-06-07 12:40:35 -07:00
PatrickJS 53083c0b52 refactor(testing): type beforeEachProviders (#9023)
these are valid otherwise
```typescript
beforeEachProviders(1)
beforeEachProviders('wat')
beforeEachProviders([
  Http
])
```
2016-06-04 19:52:51 -07:00
Pawel Kozlowski 057abefe50 fix(compiler): report errors for queries without selectors (#9018)
Fixes #4489
2016-06-04 19:46:03 -07:00
Matias Niemelä a1e3004e62 docs(animations): provide API docs for the animation DSL
Closes #8970
2016-06-03 18:57:17 -07:00
Matias Niemelä e504d4eb05 fix(renderer): remove unecessary setElementStyles method
There is no need to expose this additional method inside of the Renderer
API. The functionality can be restored by looping and calling
`setElementStyle` instead.

Note that this change is changing code that was was introduced after
the last release therefore this fix is not a breaking change.

Closes #9000
Closes #9009
2016-06-03 15:20:34 -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 27a47e7841 refactor(imports): simplify paths 2016-06-03 14:46:04 -07:00
Matias Niemelä fa0718ba9a feat(animations): provide support for offline compilation 2016-06-03 14:36:11 -07:00
Matias Niemelä 155b88213c feat(debug): collect styles and classes for the DebugElement 2016-06-03 14:36:06 -07:00
Tobias Bosch ddd2ac4f55 fix(core): fix type of `DebugNode.properties` (#8964)
Properties can have any value, not just strings.
2016-06-03 10:51:13 -07:00
Igor Minar 76e6214b9b chore: remove angular_entry point (#8975)
this is obsolete and no longer needed. it wasn't part of the public api so it's ok to remove.
2016-06-03 10:47:55 -07:00
Miško Hevery b160ada5d1 fix: QueryList documentation (#8976) 2016-06-02 16:24:26 -07:00
Tobias Bosch 04220be8fd chore: remove old tests (#8954)
These tests are already captured in template_parser_spec.ts
2016-06-01 16:30:51 -07:00
laco0416 602836800b feat(ChangeDetectorRef): make detectChanges() correct
Closes #8599
2016-06-01 12:50:47 -07:00
Igor Minar a3cf58b67a docs: add info about __moduleName into to DirectiveMetadata docs 2016-06-01 10:43:22 -07:00
Igor Minar 7bc2d9a93a docs: add api stability indicators for @angular/common 2016-06-01 10:43:22 -07:00
Vikram Subramanian f4f6b8721a fix(core): Keep core exports seperate from core/testing exports. 2016-05-31 20:09:43 -07:00
opensrcken 7e352a27f7 fix(d.ts): enable angular2 compilation with TS flag --strictNullChecks (#8902)
Eliminate the following compiler error when using TS 1.9+ with strict null checking enabled:

node_modules/@angular/core/src/util/decorators.d.ts(9,5): error TS2411: Property 'extends' of type 'Type | undefined' is not assignable to string index type 'Type | Function | any[]'.

https://github.com/angular/angular/issues/8720
2016-05-31 18:25:48 -07:00
Alex Eagle 3331321f64 build(ngc): run integration test hermetically
This ensures we run in a clean directory, using our real distribution. It finds bugs like @internal
APIs needed to type-check in the offline compiler, as well as problems in package.json.

Also move tsc-wrapped under tools/@angular
2016-05-27 17:21:35 -07:00
Alex Eagle c6064a30a1 chore(package.json): make the packages installable 2016-05-27 17:21:34 -07:00
Alex Eagle b5d14c26d2 chore(lint): enable requireInternalWithUnderscore tslint check 2016-05-27 09:31:18 -07:00
Alex Eagle 2019050db2 chore(lint): enable duplicateModuleImport tslint check 2016-05-27 09:17:08 -07:00
Alex Eagle ef0c32512c chore(lint): enable semicolon and variable-name tslint checks 2016-05-26 15:46:03 -07:00
laco0416 f93512bf27 feat(ViewEncapsulation): default ViewEncapsulation to configurable
BREAKING CHANGES:

DirectiveNormalizer takes new constructor arguments, `config:CompilerConfig`.

Closes #7883
2016-05-26 13:23:37 -07:00
Andrii Nechytailov 9036f78b74 fix(compiler): throw an error if variable with the same name is already defined. (#7209)
* fix(compiler): throw an error if variable with the same name is already defined. Closes #6492

* fix(compiler): Clean up formatting for issue #6492

* fix(compiler): throw an error if reference with the same name is already defined.

Closes #6492
2016-05-26 13:04:17 -07:00
Matt Wheatley b7b56785d1 fix(Renderer): update signatures to make RenderDebugInfo optional
The code does not force the user to provider `RenderDebugInfo`. The
current implementation lists this as a mandatory parameter. Update
the parameter to be optional.

Fixes #8466

Closes #8859
2016-05-26 10:32:03 -07:00
Zach Bjornson 3a62023260 docs(LifecycleHooks): correct ngDoCheck description (#8807)
The current behavior is for ngDoCheck to supplement, not override, the default change detector. OnChanges will still be called when DoCheck is implemented (fixes #7307).
2016-05-26 10:27:42 -07:00
Julie Ralph 0cb93a436d fix(testing): add discardPeriodicTasks to be used with fakeAsync (#8629)
Closes #8616
2016-05-26 10:19:30 -07:00
Suguru Inatomi b2e804c961 fix(metadata): Allow spacing in multiple selectors (#7418) 2016-05-26 10:18:31 -07:00
Ajay Ambre c27bc1956b docs(API): correct formatting of EmbeddedViewRef API doc example (#8584)
remove ... from EmbeddedViewRef API example doc comments
2016-05-26 09:53:18 -07:00
Rob Wormald e5904f4089 fix(facade): change EventEmitter to be sync by default (#8761) 2016-05-26 09:34:04 -07:00
Igor Minar b9347eb01c build: remove dependency on tsd and use @types/* instead 2016-05-25 16:42:28 -07:00
Igor Minar 4dbd8ed6b8 refactor: remove unnecessary annotations 2016-05-25 16:42:28 -07:00
Miško Hevery 39ecd01b86 chore: audit @angular/core API classification (#8808) 2016-05-25 15:00:05 -07:00
Matias Niemelä 5e0f8cf3f0 feat(core): introduce support for animations
Closes #8734
2016-05-25 13:56:50 -07:00
Igor Minar 2ab1085dfb fix(core): remove @internal annotation from PLATFORM_CORE_PROVIDERS
This symbol is no longer reexported at the top level, so it's safe to not mark it as internal.

This fixes the offline compilation which got broken by this symbol not being present in the d.ts
files when the compiler tries to do a deep import.

Closes #8819
2016-05-25 08:22:07 -07:00
Igor Minar 16dfe3c63f build: consolidate tsc to ease migration to @types/ based typings delivery
I actually tried to use @types/* directly but came across several issues which prevented me
from switching over:
- https://github.com/Microsoft/TypeScript/issues/8715
- https://github.com/Microsoft/TypeScript/issues/8723
2016-05-25 08:22:07 -07:00
Borys Semerenko e82b700ad0 docs(directives): add a deprecation comment for properties, events
Closes #7059
2016-05-24 21:13:56 -07:00
Wassim Chegham 1513e201bb docs(ContentChild): add example with refs
Add missing example on how ContentChild works with refs
Closes #7160
Closes #7162
2016-05-24 20:57:25 -07:00
Matias Niemelä 1ac38bd69a feat(renderer): add a `setElementStyles` method 2016-05-24 18:42:05 -07:00
Thierry Templier 0f0a8ade7c feat(http): automatically set request Content-Type header based on body type
Implement the ability to provide objects as request body. The following use cases
are supported:
* raw objects: a JSON payload is created and the content type set to `application/json`
* text: the text is used as it is and no content type header is automatically added
* URLSearchParams: a form payload is created and the content type set to `application/x-www-form-urlencoded`
* FormData: the object is used as it is and no content type header is automatically added
* Blob: the object is used as it is and the content type set with the value of its `type` property if any
* ArrayBuffer: the object is used as it is and no content type header is automatically added

Closes https://github.com/angular/http/issues/69

Closes #7310
2016-05-24 11:42:37 -07:00
Victor Berchet f95a604b59 fix(bootstrap): swap coreBootstrap() and coreLoadAndBootstrap() arguments 2016-05-23 17:57:28 -07:00
Victor Berchet 3ff20cd7e3 fix(core): fix build 2016-05-23 17:56:48 -07:00
Ward Bell 0a872ffd38 feat(core/linker): add SimpleChanges type to lifecycle_hooks to simplify OnChanges signature
Closes #8557
2016-05-23 16:11:52 -07:00
Vamsi Varikuti 0795dd307b refactor(chore): Replace all 'bindings' with 'providers'
BREAKING CHANGE

Deprecated `bindings:` and `viewBindings:` are replaced with
`providers:` and `viewProviders:`

Closes #7687
2016-05-23 13:31:08 -07:00
Justin DuJardin c43636f2bb fix(di): type error in InvalidProviderError
- when trying to instantiate an injector with an unknown provider
Closes #7729
2016-05-23 13:08:10 -07:00
Igor Minar 0035575c82 build: turn on tsc's stripInternal when producint public d.ts file
I also made some changes to fix imports and remove some stuff that caused
breakage once stripInternals was turned on.
2016-05-20 10:59:57 -07:00
Drew Moore 1bff47f97d docs: fix syntax errors in HostBinding metadata example
add missing parentheses to getters, remove erroneous brackets in HostBindings

Closes #8269
2016-05-20 10:56:11 -07:00
Jake Garelick 19e65382f7 fix(core): accurate dev mode message for dart (#8403) 2016-05-20 10:01:39 -07:00
PatrickJS 587c119c75 feat(NgZone): isStable
Closes #8108
2016-05-19 16:10:08 -07:00
Victor Berchet 6e62217b78 fix(WebWorker): remove the platform-browser dependency on compiler 2016-05-18 16:23:09 -07:00
Joost de Vries a01a54c180 adds 'repository' metadata to npm modules (#8649) 2016-05-17 23:17:15 -07:00
Alex Eagle 9e3df8eefe chore(tsickle): remove redundant jsdoc types
tsickle doesn't like them, and anyway they are bound to get out-of-sync with the inline TS types
2016-05-10 17:38:10 +02:00
Martin Probst f86edae9f3 feat(security): add an HTML sanitizer.
This is based on Angular 1's implementation, parsing an HTML document
into an inert DOM Document implementation, and then serializing only
specifically whitelisted elements.

It currently does not support SVG sanitization, all SVG elements are
rejected.

If available, the sanitizer uses the `<template>` HTML element as an
inert container.

Sanitization works client and server-side.

Reviewers: rjamet, tbosch , molnarg , koto

Differential Revision: https://reviews.angular.io/D108
2016-05-09 16:00:24 +02:00
Tobias Bosch 6d36a7a45f chore: fix unit tests on node.js
Closes #8476
2016-05-04 18:00:29 -07:00
Tobias Bosch e2b1e1577d fix(core): don’t detach nested view containers when destroying a view
When a view is destroyed, we destroy all
views in view containers and should not detach them. However, previously, we also detached them which lead to problems during the iteration loop.

Closes #8458
Closes #8471

Introduced by 0c600cf6e3
2016-05-04 16:27:20 -07:00
vsavkin 1a0aea67a0 feat(core): add a component resolver that can load components lazily using system.js 2016-05-04 14:50:00 -07:00
vsavkin 0f1465b899 feat(router): update router to support lazy loading 2016-05-04 14:50:00 -07:00
Tobias Bosch 7150ace7c7 fix(compiler): support lifecycle hooks in compiler_cli 2016-05-04 12:14:43 -07:00
Tobias Bosch edec158dd8 fix(compiler_cli): allow to use builtin directives like `NgIf`, …
Related to #8448
Closes #8454
2016-05-03 20:49:17 -07:00
Tobias Bosch 0297398f5e chore: clang-format master 2016-05-03 18:56:39 -07:00
Igor Minar 905f38acb8 build: fix source map paths for npm packages
the bundles have source mpas disabled for now because when we downlevel
the esm bundle to es5 tsc doesn't consider the original source map so
we end up with a source map pointing to the esm bundle instead which is
not useful.
2016-05-03 13:36:33 -06:00
Martin Probst 908a102a87 feat: security implementation in Angular 2.
Summary:
This adds basic security hooks to Angular 2.

* `SecurityContext` is a private API between core, compiler, and
  platform-browser. `SecurityContext` communicates what context a value is used
  in across template parser, compiler, and sanitization at runtime.
* `SanitizationService` is the bare bones interface to sanitize values for a
  particular context.
* `SchemaElementRegistry.securityContext(tagName, attributeOrPropertyName)`
  determines the security context for an attribute or property (it turns out
  attributes and properties match for the purposes of sanitization).

Based on these hooks:

* `DomSchemaElementRegistry` decides what sanitization applies in a particular
  context.
* `DomSanitizationService` implements `SanitizationService` and adds *Safe
  Value*s, i.e. the ability to mark a value as safe and not requiring further
  sanitization.
* `url_sanitizer` and `style_sanitizer` sanitize URLs and Styles, respectively
  (surprise!).

`DomSanitizationService` is the default implementation bound for browser
applications, in the three contexts (browser rendering, web worker rendering,
server side rendering).

BREAKING CHANGES:
*** SECURITY WARNING ***
Angular 2 Release Candidates do not implement proper contextual escaping yet.
Make sure to correctly escape all values that go into the DOM.
*** SECURITY WARNING ***

Reviewers: IgorMinar

Differential Revision: https://reviews.angular.io/D103
2016-05-03 09:21:43 -07:00
Tobias Bosch dd6e0cf1b5 fix(compiler): fix where pipes live
Impure pipes need to live on the view
that used them and need a new instance for
each call site.

Impure pipes need to live on the component view, cached across all child views,
and need a new pure proxy for each for
each call site that lives on the view
of the call site.

Fixes #8408

This bug was introduced not long ago by 152a117d5c
2016-05-03 09:00:23 -07:00
Tobias Bosch 43527172ed chore: don’t shadow `tsconfig.json` used for editors by build specific tsconfig.json 2016-05-02 15:06:46 -07:00
Misko Hevery 107016ec12 chore: router move import changes 2016-05-02 13:27:03 -07:00
Tobias Bosch b6fd81169b feat(core): support the decorator data that tsickle produces 2016-05-01 23:40:59 -07:00
Alex Eagle 3ae856ab8b build(tsc): Use angular2-template-compiler in place of tsc
This lets us down-level Decorators with tsickle and produce .metadata.json
files for users to reference when offline-compiling their app.
2016-05-01 23:40:59 -07:00
Misko Hevery 3e17c99f4e chore: clang-reformat 2016-05-01 22:59:41 -07:00
Misko Hevery 6e79de794c fix: function name shim test 2016-05-01 22:27:55 -07:00
Alex Eagle c4be30d2e8 Revert "build(tsc): Use angular2-template-compiler in place of tsc"
This reverts commit 3d25294f706e0fd6224b20372be1e961959c0af8.
2016-05-01 20:51:00 -07:00
Alex Eagle 57240c85a5 build(tsc): Use angular2-template-compiler in place of tsc
This gives us tsickle pre-processing of Decorators, and produces
.metadata.json files for users to consume in their offline compilation.
2016-05-01 20:51:00 -07:00
Igor Minar a66cdb469f repackaging: all the repackaging changes squashed 2016-05-01 20:51:00 -07:00
Igor Minar 505da6c0a8 repackaging: all the file moves 2016-05-01 20:51:00 -07:00