Skip to content

docs(Ng1StateHooks): Corrected interface and docs #3076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2016
Merged

docs(Ng1StateHooks): Corrected interface and docs #3076

merged 1 commit into from
Nov 2, 2016

Conversation

csvn
Copy link
Contributor

@csvn csvn commented Oct 8, 2016

Updated interfaces and documentation to fix #3072

Not sure if documentation looks correct, since I wasn't able to build it correctly.

@csvn
Copy link
Contributor Author

csvn commented Oct 8, 2016

With this change, at least typings/Typescript won't throw errors with dependency injection in Angular 1.

EDIT:
I tried this out with the following:

let state: Ng1StateDeclaration = {
  onEnter(a, b) {
    // a and b are shown as type "any" instead of "Transition" and "State"
    // Also, the description shown is the one on Ng1StateDeclaration and not 
    // inherited from the StateDeclaration interface
  }
};

EDIT 2:
Typescript example for before/after the changes.
state-declaration-interface-diff

@csvn csvn closed this Oct 21, 2016
@christopherthielen
Copy link
Contributor

Did you mean to close this?

@csvn
Copy link
Contributor Author

csvn commented Oct 21, 2016

No, I messed up with my master branch and it closed automatically. I could not open it :)

I was looking into the travis build failures. I found out why it's messed up. But maybe this is not the right place to discuss it, or you might already know how to fix it.

@csvn
Copy link
Contributor Author

csvn commented Oct 21, 2016

The failed check in travis can be solved by upgrading npm above v3 (found it here). I tried this on my fork, and it made that particular error go away.

The next error that pops up is due to the cloning and installing of ui-router/core from travis. When npm install ./ui-router-core is run, it will trigger the prepublish hook in ui-router/core (which will be deprecated in npm@4). This would be fine, except that the npm test script fails miserably due to no node_modules being installed (SystemJS fails to find any of the imports specified in node_modules).

So a possible solution would be to cd ui-router-core && npm i && cd .. to install node_modules in the cloned core repo, but that would add alot of time to the build. Since I could not find an easy solution to the failing Travis build, I'll just add my findings here for now.

Build fixed this weekend. Ignore this comment :)

for state transition hooks onEnter, onExit & onRetain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

State.onEnter() does not behave as documented
2 participants