Skip to content

Commit 83f7c9b

Browse files
4.0.0
1 parent d2d8058 commit 83f7c9b

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
# 4.0.0 (2018-02-15)
2+
[Compare `@uirouter/angular-hybrid` versions 3.1.10 and 4.0.0](https://github.com/ui-router/angular-hybrid/compare/3.1.10...4.0.0)
3+
4+
### Bug Fixes
5+
6+
* **package:** Move types/* dependencies to devDependencies ([9c87ae6](https://github.com/ui-router/angular-hybrid/commit/9c87ae6))
7+
8+
9+
### Features
10+
11+
* **NgModule:** Add UIRouterUpgradeModule.forChild() ([a867ffb](https://github.com/ui-router/angular-hybrid/commit/a867ffb))
12+
* **typings:** add types for hybrid state declaration ([f5a6c73](https://github.com/ui-router/angular-hybrid/commit/f5a6c73))
13+
14+
15+
### BREAKING CHANGES
16+
17+
* **NgModule:** - Remove standalone import of `UIRouterUpgradeModule`.
18+
- Use `UIRouterUpgradeModule.forChild()` instead of `UIRouterModule.forChild()`.
19+
- Cast states as `NgHybridStateDeclaration`.
20+
21+
The `angular-hybrid` library processes state's `onEnter`/`onExit`/`onRetain` as AngularJS style injected functions. However, the typescript typings when using `UIRouterModule.forChild()` were not compatible with AngularJS style injected callbacks. This release adds typings supporting AngularJS style callbacks on state declarations.
22+
23+
```ts
24+
export const mystate: NgHybridStateDeclaration = { // cast
25+
name: 'mystate',
26+
url: '/mystate',
27+
component: MyAngularComponent,
28+
onEnter: myStateOnEnter,
29+
};
30+
31+
myStateOnEnter.$inject = ['$state'];
32+
export function myStateOnEnter($state) {
33+
console.log('$state was injected', $state);
34+
}
35+
36+
@NgModule({
37+
imports: [
38+
BrowserModule,
39+
UpgradeModule,
40+
// remove this: UIRouterUpgradeModule,
41+
// remove this: UIRouterModule.forChild( ... ),
42+
UIRouterUpgradeModule.forChild({ states: [mystate] }), // replace with this
43+
]
44+
})
45+
```
46+
147
## 3.1.10 (2018-02-12)
248
[Compare `@uirouter/angular-hybrid` versions 3.1.9 and 3.1.10](https://github.com/ui-router/angular-hybrid/compare/3.1.9...3.1.10)
349

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uirouter/angular-hybrid",
3-
"version": "3.1.10",
3+
"version": "4.0.0",
44
"scripts": {
55
"example": "cd example && npm i && npm start",
66
"clean": "shx rm -rf lib _bundles",

0 commit comments

Comments
 (0)