by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 05 18:39

    dependabot-preview[bot] on npm_and_yarn

    (compare)

  • Jun 05 18:39

    dependabot-preview[bot] on master

    build(deps): [security] bump we… Merge pull request #255 from ui… (compare)

  • Jun 05 18:39
    dependabot-preview[bot] closed #255
  • Jun 05 18:37
    dependabot-preview[bot] labeled #255
  • Jun 05 18:37
    dependabot-preview[bot] labeled #255
  • Jun 05 18:37
    dependabot-preview[bot] opened #255
  • Jun 05 18:37

    dependabot-preview[bot] on npm_and_yarn

    build(deps): [security] bump we… (compare)

  • Jun 05 16:20

    dependabot-preview[bot] on npm_and_yarn

    (compare)

  • Jun 05 16:20

    dependabot-preview[bot] on master

    build(deps): [security] bump we… Merge pull request #231 from ui… (compare)

  • Jun 05 16:20
    dependabot-preview[bot] closed #231
  • Jun 05 16:18
    dependabot-preview[bot] labeled #231
  • Jun 05 16:18
    dependabot-preview[bot] labeled #231
  • Jun 05 16:18
    dependabot-preview[bot] opened #231
  • Jun 05 16:18

    dependabot-preview[bot] on npm_and_yarn

    build(deps): [security] bump we… (compare)

  • Jun 01 15:07

    dependabot-preview[bot] on npm_and_yarn

    (compare)

  • Jun 01 15:07
    dependabot-preview[bot] closed #251
  • Jun 01 15:07
    dependabot-preview[bot] commented #251
  • Jun 01 15:07
    dependabot-preview[bot] labeled #254
  • Jun 01 15:07
    dependabot-preview[bot] opened #254
  • Jun 01 15:07

    dependabot-preview[bot] on npm_and_yarn

    build(deps-dev): bump fork-ts-c… (compare)

Cody Mikol
@codymikol
The second is not a parent of the first
So calling state.go(‘^’) will attempt to go to an abstract root state that I have
I ended up making everything have a parent child relationship
Which works but not really as I’d like it to
As we have requirements that we should not retain any data between different states
Tom McKearney
@tommck
Hey all, does anyone know which of the LifeCycle hooks occurs just before resolve parameters for the next state are evaluated? I find it hard to understand the order of operations in a state transition
tommck @tommck thinks it's onExit
During a transition, some states may be exited, retained, and/or entered.
onExit first, then onRetain, finally onEnter
Each of these hooks happen for each state in the transition
so, multiple onExit hooks may be called if multiple states are exited. Likewise with onRetain and onEnter
@tommck
resolve data is fetched during onEnter
general advise is to use an onStart hook if you want to do something before resolve data is fetched. If you need more granularity than that you can of course use any other hook
You could theoretically even add an onEnter hook that is higher priority than the hook that fetches resolve data if you want to execute code just before the resolves are fetched. However, this smells not quite right
Chris Thielen
@christopherthielen
Tom McKearney
@tommck
so, let's say I have messages that are associated with a ui state at the top of the screen and want to clear then on state transition. YOu think onStart is the right place for that?
messages for the new state can be added in resolves
Chris Thielen
@christopherthielen
onExit seems appropriate for that
FWIW I only ever use resolve to fetch data. I use a hook like onEnter/onStart/onFinish for everything else.
Tom McKearney
@tommck
@christopherthielen our API sends a HAL-like format back with data and messages/alerts and permission data all in one structure
Chris Thielen
@christopherthielen
👍
Troy Hawley
@troywoy
Is there a way to prevent ui-router from stripping unspecified parameters from the hash? For example I have /#!/foobar/?id=123&randomVar=apples&anotherRandomVar=carrots with a route url defined as foobar/?id. Since my random vars aren't part of the route they seem to be removed and I'm not entirely sure if it's my fault or intended via library code. There's a variety of parameters I would like to support, and I don't want to have to put each and every one on the route (I'd rather do something like $location.search().randomVar if I need to use it).
Troy Hawley
@troywoy
I think this was working and parameters weren't removed when I was using v0.x but now acts differently with v1.x
Chris Venevongsos
@cxvvs

Hello,
I’m playing around with the resolvers and I don’t understand the behaviour when specifying a resolve policy async: NOWAIT .

What I’m doing :
Accessing a state that has one resolver function that returns a promise. That promises takes some time to complete, and it is then used by the state (in my case an Angular component)

What happens :

  • With a resolve policy of async : WAIT (the default), the promise is waited on, unwrapped and its result is given to the component
  • With a resolve policy of async : NOWAIT, the promise is not waited on, and the component receives an undefined value

What I expected :

Sample to reproduce :
https://stackblitz.com/edit/github-xn962p-6rs1go?file=src/app/app.module.ts
The resolve policy is set to WAIT (app.module.ts) and everything is working as intended (the console prints the value received by the component)
If you change it to NOWAIT, the component receives undefined (check the console).

Mark Wilkins
@markwilk
Having trouble creating a plnkr to replicate, so thought I'd ask to see if this rings a bell for anyone... Have you ever had a case where the browser's back button updates the URL, but the state doesn't actually change? And then, if I click any link/state in the view, the state DOES change to where I expected the back button to take me, not that target of the clicked link? Details to follow...
AngularJS 1.7.3, ui-router 1.1.40. I start at state a.b.c, which has nested views, and has a list of "items". I click on an item in the innermost view, which takes me to state d.
Mark Wilkins
@markwilk
Then I hit the back button from state d, and the URL changes back to a.b.c, and the state loads correctly.
BUT THEN
Cody Mikol
@codymikol
Any console errors?
Mark Wilkins
@markwilk
I follow the same link from a.b.c, or even a different one, and the I go to a new "item".
The second (and every subsequent) time, the back button updates the URL, but doesn't change the state back to a.b.c
@codymikol no, no errors.
And I have tracing turned on, but nothing is written out for those subsequent clicks of the back button
UNTIL I click some other link on the "item" page...and then it takes me where the back button should have taken me
Again, sorry no plnkr...but I couldn't get it to fail there. :-/
Cody Mikol
@codymikol
@markwilk Doesn't ring a bell unfortunately :(
Mark Wilkins
@markwilk
Thanks for replying, @codymikol . When I get a few more minutes, I'll try the plnkr again.
Mark Wilkins
@markwilk
Duh. Turned out that an unrelated directive was unbinding too many window events, which was causing the issue. Never mind. :-/
Cody Mikol
@codymikol
:D
Chris Thielen
@christopherthielen
@cxvvs that does look like a bug 🤔 I would have expected a promise injected
Tom McKearney
@tommck
Hey @christopherthielen .. any chance you can address this? ui-router/core#229
Chris Thielen
@christopherthielen
I’ll try to make some time this week
Tom McKearney
@tommck
:+1:
Chris Thielen
@christopherthielen
@tommck how do I reproduce this typescript error?
Tom McKearney
@tommck
build any app that uses it with "strict": true in the tsconfig.json
Chris Thielen
@christopherthielen
ah, let me try that
got it, thanks
Tom McKearney
@tommck
awesome.. thanks for doing that