Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
130f344
docs(API/core/decorator): note input and output are optional (#156)
aciccarello Sep 22, 2016
dac2159
docs(api/testing) add more testing recipies (#140)
Sep 27, 2016
5379df7
Merge pull request #164 from ngParty/3.x
Hotell Oct 20, 2016
b6909e4
chore(release): bump version to 3.0.0
Hotell Oct 20, 2016
aaabe30
docs(changelog): update changelog to 3.0.0
Hotell Oct 20, 2016
3eb047d
fix(manual_typings): make custom global angular overrides work with b…
Hotell Oct 20, 2016
275f200
chore(release): bump version to 3.0.1
Hotell Oct 20, 2016
54b5257
docs(changelog): update changelog to 3.0.1
Hotell Oct 20, 2016
0ba808c
fix(npm): remove reflect-metadata from peerDeps as user can use core-…
Hotell Oct 21, 2016
02e1deb
docs(README): update plunks to 3.x version
Hotell Oct 21, 2016
c435f28
Merge pull request #168 from ngParty/peerDeps-fix
Hotell Oct 21, 2016
07dad12
chore(release): bump version to 3.0.2
Hotell Oct 21, 2016
6fb4dfe
docs(changelog): update changelog to 3.0.2
Hotell Oct 21, 2016
9040a2c
fix(manual_typings/globals): remove Type alias from globals and add i…
Hotell Nov 7, 2016
c489c7f
Merge pull request #172 from ngParty/Type-interface-fix
Hotell Nov 7, 2016
32ef933
chore(release): bump version to 3.0.3
Hotell Nov 7, 2016
eb4e21b
docs(changelog): update changelog to 3.0.3
Hotell Nov 7, 2016
82f72ca
refactor(build): move to npm @types defs from typings and update code…
Hotell Nov 12, 2016
3153bca
fix(build): create angular typings override so we don't have to impor…
Hotell Nov 15, 2016
e52cb27
chore(build): add new version publish script
Hotell Nov 20, 2016
e3dd9c3
chore(manual_typings): remove commented code
Hotell Nov 20, 2016
81217cf
fix(playground): add new angular-extensions and fix provide errors
Hotell Nov 20, 2016
9fe2094
Merge pull request #179 from ngParty/tweak-build-to-ts-2.x
Hotell Nov 20, 2016
3d3f724
feat(upgrade): add support for AOT via '@angular/upgrade/static' api
Hotell Nov 20, 2016
96bf124
fix(core/directives/host): execute HostListener method within sync $a…
Hotell Nov 20, 2016
947078c
feat(playground): add example for preventing user input via directive…
Hotell Nov 20, 2016
bfbdcbe
Merge pull request #181 from ngParty/fix-host-listener
Hotell Nov 20, 2016
015756e
small fixing of typos
david-gang Dec 7, 2016
1abcac3
docs(api/testing/Readme.md): small fixing of typos (#183)
Hotell Dec 8, 2016
821b772
fix(facade/lang): support Node 6 and Windows environments (#182)
aciccarello Dec 12, 2016
36f5b66
test(upgrade): add test coverage for new upgrade API
Hotell Dec 24, 2016
2ea1299
feat(packages): update to [email protected] and unpin the rxjs peerDeps via …
Hotell Dec 24, 2016
d0c0e5d
Merge pull request #180 from ngParty/upgrade/static
Hotell Dec 24, 2016
53d77d7
Upgrade aot docs (#190)
Hotell Dec 24, 2016
80c45e6
chore(release): bump version to 4.0.0
Hotell Dec 24, 2016
790fca6
docs(changelog): update changelog to 4.0.0
Hotell Dec 24, 2016
5c6cb82
chore(ci): bump to node latest node LTS
Hotell Dec 25, 2016
189770e
fix(common/async_pipe): return immediately every value if it exist in…
Hotell Dec 25, 2016
44fb558
chore(release): bump version to 4.0.1
Hotell Dec 25, 2016
650c029
docs(changelog): update changelog to 4.0.1
Hotell Dec 25, 2016
c4b11ba
Implement inject fn
aciccarello Oct 20, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ npm-debug.log
*.js
*.map
*.d.ts
!manual_typings/globals.d.ts
!manual_typings/**/*.d.ts
!playground/ng-metadata.legacy.d.ts
typings
test/__uglifyTest.js
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ npm-debug.log
*.ts
# allow only ambient type definitions
!*.d.ts
manual_typings/globals.d.ts
manual_typings/overrides
.travis.yml
.editorconfig
.npmignore
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- '4.2.1'
- '6.9.2'

install:
# Install npm dependecies
Expand Down
131 changes: 121 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,115 @@
<a name="4.0.1"></a>
## [4.0.1](https://github.com/ngParty/ng-metadata/compare/4.0.0...v4.0.1) (2016-12-25)


### Bug Fixes

* **common/async_pipe:** return immediately every value if it exist in subscriptions ([189770e](https://github.com/ngParty/ng-metadata/commit/189770e)), closes [#187](https://github.com/ngParty/ng-metadata/issues/187)



<a name="4.0.0"></a>
# [4.0.0](https://github.com/ngParty/ng-metadata/compare/3.0.3...v4.0.0) (2016-12-24)


### Bug Fixes

* **build:** create angular typings override so we don't have to import them to source ([3153bca](https://github.com/ngParty/ng-metadata/commit/3153bca)), closes [#175](https://github.com/ngParty/ng-metadata/issues/175) [#177](https://github.com/ngParty/ng-metadata/issues/177)
* **core/directives/host:** execute HostListener method within sync $apply instead of next tick ([96bf124](https://github.com/ngParty/ng-metadata/commit/96bf124)), closes [#171](https://github.com/ngParty/ng-metadata/issues/171)
* **facade/lang:** support Node 6 and Windows environments (#182) ([821b772](https://github.com/ngParty/ng-metadata/commit/821b772))
* **playground:** add new angular-extensions and fix provide errors ([81217cf](https://github.com/ngParty/ng-metadata/commit/81217cf))

### Features

* **packages:** update to [email protected] and unpin the rxjs peerDeps via ^5.0.1. Also move to stable ([2ea1299](https://github.com/ngParty/ng-metadata/commit/2ea1299)), closes [#185](https://github.com/ngParty/ng-metadata/issues/185)
* **playground:** add example for preventing user input via directive HostListener ([947078c](https://github.com/ngParty/ng-metadata/commit/947078c))
* **upgrade:** add support for AOT via '@angular/upgrade/static' api ([3d3f724](https://github.com/ngParty/ng-metadata/commit/3d3f724)), closes [#178](https://github.com/ngParty/ng-metadata/issues/178)


### BREAKING CHANGES

* build: We now officialy support only angular typings provided via npm `@types/*` and also typescript 2.x

- your existing typings provided by `typings` might not work
- from now on if you wanna use deprecated `provide` function from `ng-metadata/core` with registration within `angular.module().directive|service|filter` you have to explicitly include angular types extension provided by ng-metadata from `node_modules/ng-metadata/manual_typings/angular-extension.d.ts`

Before:
```typescript
// global.d.ts
/// <reference path="../node_modules/ng-metadata/manual_typings/globals.d.ts" />
```

After:
```typescript
/// <reference path="../node_modules/ng-metadata/manual_typings/angular-extension.d.ts" />
```

or you can include it from within your tsconfig.json like this:
```json
{
"include":[
"src/**/*.ts"
],
"files": [
"node_modules/ng-metadata/manual_typings/angular-extension.d.ts"
],
"exclude": [
"node_modules"
]
}
```



<a name="3.0.3"></a>
## [3.0.3](https://github.com/ngParty/ng-metadata/compare/3.0.2...v3.0.3) (2016-11-07)


### Bug Fixes

* **manual_typings/globals:** remove Type alias from globals and add it to every module which relies on it ([9040a2c](https://github.com/ngParty/ng-metadata/commit/9040a2c)), closes [#170](https://github.com/ngParty/ng-metadata/issues/170)



<a name="3.0.2"></a>
## [3.0.2](https://github.com/ngParty/ng-metadata/compare/3.0.1...v3.0.2) (2016-10-21)


### Bug Fixes

* **npm:** remove reflect-metadata from peerDependencies as user can use core-js or other polyfill ([0ba808c](https://github.com/ngParty/ng-metadata/commit/0ba808c))



<a name="3.0.1"></a>
## [3.0.1](https://github.com/ngParty/ng-metadata/compare/3.0.0...v3.0.1) (2016-10-20)


### Bug Fixes

* **manual_typings:** make custom global angular overrides work with both global and module type defin ([3eb047d](https://github.com/ngParty/ng-metadata/commit/3eb047d))



<a name="3.0.0"></a>
# [3.0.0](https://github.com/ngParty/ng-metadata/compare/3.0.0-beta.0...v3.0.0) (2016-10-20)


### Bug Fixes

* **core:** Fix typo in bundle error message, relax isNgModule check (fixes #155) (#159) ([52fa571](https://github.com/ngParty/ng-metadata/commit/52fa571)), closes [#155](https://github.com/ngParty/ng-metadata/issues/155) [(#159](https://github.com/(/issues/159)

### Features

* **upgrade:** Dedicated NgMetadataUpgradeAdapter bootstrap function (#160) ([f941c71](https://github.com/ngParty/ng-metadata/commit/f941c71))


### BREAKING CHANGES

* The rxjs peerDependency has been updated to 5.0.0-rc.1, and this in turn requires TypeScript of 2.x and above.



<a name="3.0.0-beta.0"></a>
# [3.0.0-beta.0](https://github.com/ngParty/ng-metadata/compare/2.2.1...v3.0.0-beta.0) (2016-09-20)

Expand All @@ -12,11 +124,10 @@

### BREAKING CHANGES

* core: All Pipes and Components must now be registered via an
NgModule's declarations array.
* core: All Pipes and Components must now be registered via an NgModule's declarations array.

**Before:**
```ts
```typescript
import { Component, Pipe } from 'ng-metadata/core'

@Component({
Expand All @@ -40,7 +151,7 @@ class MainComponent {}
```

**After:**
```ts
```typescript
import { NgModule, Component, Pipe } from 'ng-metadata/core'

@Component({
Expand Down Expand Up @@ -70,7 +181,7 @@ instantiated @angular/upgrade UpgradeAdapter, which will have been
created using an Angular 2 NgModule.

**Before:**
```ts
```typescript
import { NgMetadataUpgradeAdapter } from 'ng-metadata/upgrade'
import { UpgradeAdapter } from '@angular/upgrade'
import { Component } from 'ng-metadata/core'
Expand All @@ -88,7 +199,7 @@ upgradeAdapter.bootstrap(AppComponent, ['ng1Module'])
```

**After:**
```ts
```typescript
import { NgMetadataUpgradeAdapter } from 'ng-metadata/upgrade'
import { UpgradeAdapter } from '@angular/upgrade'
import { NgModule } from '@angular/core'
Expand All @@ -109,7 +220,7 @@ upgradeAdapter.boostrap(document.body, ['ng1Module'])
first argument instead of a Component.

**Before:**
```ts
```typescript
import { Component, bundle } from 'ng-metadata/core'

@Component({
Expand All @@ -122,7 +233,7 @@ const angular1Module = bundle(FooComponent)
```

**After:**
```ts
```typescript
import { NgModule, Component, bundle } from 'ng-metadata/core'

@Component({
Expand All @@ -142,7 +253,7 @@ const angular1Module = bundle(FooModule)
Component.

**Before:**
```ts
```typescript
import { bootstrap } from 'ng-metadata/platform-browser-dynamic'
import { Component } from 'ng-metadata/core'

Expand All @@ -155,7 +266,7 @@ bootstrap(AppComponent)
```

**After:**
```ts
```typescript
import { platformBrowserDynamic } from 'ng-metadata/platform-browser-dynamic'
import { NgModule, Component } from 'ng-metadata/core'

Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ngMetadata channel or [StackOverflow][stackoverflow] or just ping us on [twitter
## <a name="issue"></a> Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
submitting an issue to our [GitHub Repository][github]. Even better you can submit a Pull Request
with a fix. We would appreciate if you provide a [Plunker][plunker-2.x] with simulated bug that you've found
with a fix. We would appreciate if you provide a [Plunker][plunker-4.x] with simulated bug that you've found


**Please see the Submission Guidelines below**.
Expand Down Expand Up @@ -67,7 +67,7 @@ chances of your issue being dealt with quickly:
* **Motivation for or Use Case** - explain why this is a bug for you
* **Angular/ngMetadata/Typescript Version(s)** - is it a regression?
* **Browsers and Operating System** - is this a problem with all browsers or only IE8?
* **Reproduce the Error** - provide a live example (using [Plunker][plunker-2.x] or an unambiguous set of steps.
* **Reproduce the Error** - provide a live example (using [Plunker][plunker-4.x] or an unambiguous set of steps.
* **Related Issues** - has a similar issue been reported before?
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
causing the problem (line of code or commit)
Expand Down Expand Up @@ -249,4 +249,6 @@ You can find out more detailed information about contributing in the
[unit-testing]: https://docs.angularjs.org/guide/unit-testing
[plunker-1.x]: https://plnkr.co/edit/s2lYnI
[plunker-2.x]: https://plnkr.co/edit/7Fr7oO
[plunker-3.x]: https://plnkr.co/edit/Bds0Bk
[plunker-4.x]: https://plnkr.co/edit/hsz8KF

34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Behind the scenes it uses ES.next decorators extended by TypeScript (which adds

## Quick start

- [Plunkr][plunker-2.x] - try it out in your browser
- [Plunkr][plunker-4.x] - try it out in your browser
- [Playground][playground] - live docs examples and mandatory TODO app example
- [Production ready starter kit][ngParty-Angular-1-scaffold] - Starter Kit ready for production by ngParty team powered by Webpack

Expand Down Expand Up @@ -218,13 +218,20 @@ ng-metadata requires certain polyfills in the application environment. We instal

Install peer dependencies by running:

`npm i --save reflect-metadata core-js [email protected]`
`npm i --save [email protected]`

**rxjs** - a polyfill for the Observables specification currently before the TC39 committee that determines standards for the JavaScript language. Developers should be able to pick a preferred version of rxjs (within a compatible version range) without waiting for ng-metadata updates.

Install polyfills by runing:

`npm i --save core-js`

You also need to provide `Reflect.metadata` shim. This can be done by installing `npm i --save reflect-metadata` or by importing `import 'core-js/es7/reflect'` from `core-js`

**core-js** - monkey patches the global context (window) with essential features of ES2015 (ES6). Developers may substitute an alternative polyfill that provides the same core APIs. This dependency should go away once these APIs are implemented by all supported ever-green browsers.

**reflect-metadata** - a dependency shared between ng-metadata and the TypeScript compiler. Developers should be able to update a TypeScript package without upgrading ng-metadata, which is why this is a dependency of the application and not a dependency of ng-metadata.

**rxjs** - a polyfill for the Observables specification currently before the TC39 committee that determines standards for the JavaScript language. Developers should be able to pick a preferred version of rxjs (within a compatible version range) without waiting for ng-metadata updates.


### Configure your project
Expand Down Expand Up @@ -264,7 +271,8 @@ We typically add a TypeScript configuration file (`tsconfig.json`) to our projec

#### TypeScript Declaration Files

Many JavaScript libraries such as jQuery, the Jasmine testing library, and Angular itself, extend the JavaScript environment with features and syntax that the TypeScript compiler doesn't recognize natively. When the compiler doesn't recognize something, it throws an error.
Many JavaScript libraries such as jQuery, the Jasmine testing library, and Angular itself, extend the JavaScript environment with features and syntax that the TypeScript compiler doesn't recognize natively.
When the compiler doesn't recognize something, it throws an error.

We use TypeScript type declaration files — *d.ts files* — to tell the compiler about the libraries we load.

Expand All @@ -291,21 +299,7 @@ That's it! You are good to go!

## Why?

There is already an existing project, which gives us Angular 2 like syntax for Angular 1, [ng-forward](https://github.com/ngUpgraders/ng-forward)

While I respect all the hard work of the `ng-forward` team, there were things that I didn't like about their solution.

Anyway that project (ngForward) is unmaintained with old/wrong angular 2 API's and isn't production ready at all.

- it tries to mirror angular 2 with lots of under the hood abstractions which is just not feasible because there are major differences, how things work in ng1 an ng2
- it tries to do a lot unnecessary work, which was never finished ( support ES5/ES6 like angular 2 does )
- doesn't provides angular 2 like DI via constructor parameters because `babel` just won't support parameter decorators
- forces you to rewrite templates, so you can't be just 100% sure that your code will work as before

> although we started a discussion about [collaboration](https://github.com/ngUpgraders/ng-forward/issues/138) I just don't think after further analysis, that we can merge
our project one way or another.'

so those are just few reasons why I made **ng-metadata**.
those are just few reasons why I made **ng-metadata**.

**ng-metadata:**
- can be used as part of an upgrade strategy, which may also include *ng-upgrade*, when migrating to Angular 2
Expand Down Expand Up @@ -334,5 +328,7 @@ if you aren't a member just join us [ngParty slack](https://ngparty.herokuapp.co

[plunker-1.x]: https://plnkr.co/edit/s2lYnI
[plunker-2.x]: https://plnkr.co/edit/7Fr7oO
[plunker-3.x]: https://plnkr.co/edit/Bds0Bk
[plunker-4.x]: https://plnkr.co/edit/hsz8KF
[playground]: https://github.com/ngParty/ng-metadata/tree/master/playground
[ngParty-Angular-1-scaffold]: https://github.com/ngParty/Angular1-scaffold
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* [Class](/docs/api/router-deprecated/class.md)
* [Interface](/docs/api/router-deprecated/interface.md)
* [ng-metadata/upgrade](/docs/api/upgrade/README.md)
* [Function](/docs/api/upgrade/function.md)
* [Class](/docs/api/upgrade/class.md)
* [angular 1 specific api](/docs/api/ng-1-misc/README.md)
4. [Contributing](/CONTRIBUTING.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/api/core/decorator.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ name if JS engine doesn't implements ES6 name property

An alternative and more declarative way to using the `inputs` property on `@Component`/`@Directive`.

Binds to Component/Directive via on of binding types `=`/`<`/`@`.
Binds to Component/Directive via on of binding types `=`/`<`/`@` with the optional ? alias in Angular 1 syntax terms.

Binding type is determined by template or if you wanna keep template as is you have to provide on of these types within @Input(`BINDING_TYPE`)

Expand Down Expand Up @@ -496,7 +496,7 @@ class MenuDropdown {
## @Output

An alternative and more declarative way to using the `outputs` property on `@Component`/`@Directive`.
Via `@Output` and `EventEmitter` you can emit custom events to parent component
Via `@Output` and `EventEmitter` you can emit custom events to parent component. These output parameters are optional in the template.

*Example:*

Expand Down
Loading