Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 19 13:47
    dependabot-preview[bot] edited #158
  • Aug 19 13:47
    dependabot-preview[bot] edited #159
  • Aug 19 13:33

    dependabot-preview[bot] on npm_and_yarn

    (compare)

  • Aug 19 13:33
    dependabot-preview[bot] closed #156
  • Aug 19 13:33
    dependabot-preview[bot] commented #156
  • Aug 19 13:33
    dependabot-preview[bot] labeled #159
  • Aug 19 13:33
    dependabot-preview[bot] opened #159
  • Aug 19 13:33

    dependabot-preview[bot] on npm_and_yarn

    build(deps-dev): bump webpack f… (compare)

  • Aug 19 13:32

    dependabot-preview[bot] on npm_and_yarn

    (compare)

  • Aug 19 13:32
    dependabot-preview[bot] closed #151
  • Aug 19 13:32
    dependabot-preview[bot] commented #151
  • Aug 19 13:32
    dependabot-preview[bot] labeled #158
  • Aug 19 13:32
    dependabot-preview[bot] opened #158
  • Aug 19 13:32

    dependabot-preview[bot] on npm_and_yarn

    build(deps-dev): bump webpack-c… (compare)

  • Aug 19 12:03
    dependabot-preview[bot] commented #185
  • Aug 19 12:03
    dependabot-preview[bot] commented #184
  • Aug 19 12:02
    dependabot-preview[bot] labeled #185
  • Aug 19 12:02
    dependabot-preview[bot] opened #185
  • Aug 19 12:02

    dependabot-preview[bot] on npm_and_yarn

    build(deps-dev): bump webpack f… (compare)

  • Aug 19 12:02
    dependabot-preview[bot] labeled #184
Chris Thielen
@christopherthielen
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
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
codymikol
@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. :-/
codymikol
@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. :-/
codymikol
@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
Deepak
@deepak20c
how to call any service while closing window/tab
Tom McKearney
@tommck
that has nothing to do with routing
Tom McKearney
@tommck
If you want to do lazy loading in Angular, do you need to use SystemJS? I'm a little confused about the implied dependency there
Tom McKearney
@tommck
Unrelated: this code: https://github.com/ui-router/sample-app-angular doesn't have a tsconfig.json file and won't run w/ "npm start" (gets a bunch of TS errors in the node_modules folder) (Created an issue: https://github.com/ui-router/sample-app-angular/issues/332#issue-419528912)
Tom McKearney
@tommck
might not be related to the tsconfig file
Tom McKearney
@tommck
NOTE: That code does have a tsconfig.json, it's just not in the root folder
Chris Thielen
@christopherthielen
No you don’t need systemjs
There is some DI provider with SystemJS in the name that I think is required, but it doesn’t actually use SystemJS. if I remember correctly
Shawn Rieger
@riegersn
Hello! I’m trying to modify state param mid transition, during the resolve (ui-router /angularjs) Is this possible?
Chris Thielen
@christopherthielen
Hi Shawn. The idiomatic way is to redirect the transition if you need to change params
you can’t really do that from a resolve but you can from a transition hook
Tom McKearney
@tommck
Hey all, @christopherthielen - any chance you can take a look at this problem on SO? https://stackoverflow.com/questions/55579916/uirouter-angular-error-staticinjectorerrorappmodulefooservice-stateservi
We've been having this issue on and off and can't figure out what's causing it
tommck @tommck thinks it's time to move away from ui-router