These are chat archives for ngUpgraders/ng-forward

2nd
Mar 2016
Nathan Erickson
@Luwdo
Mar 02 2016 21:15

hey guys I am trying to use the @StateConfig for the first time and I see that it require the ui-router to be loaded for it to work, now heres where I am alittle confused, there seems to be 2 ways in which the ui-router gets loaded and actually 2 difference ui-router packages

require("angular-ui-route");
providers: ["ui.router"]

or

import uiRouter from 'ui-router';
providers: [uiRouter ]
now that uiRouter i think is this package https://www.npmjs.com/package/ui-router
are they interchangeable? or is one better to use then the other?
Tim Kindberg
@timkindberg
Mar 02 2016 21:17
Do from npm
One is the github repo of the npm package. Same thing.
Nathan Erickson
@Luwdo
Mar 02 2016 21:18
oh, wait so
its an alias then, must have missed that, because my original play was to npm install angular-ui-route and typings install angular-ui-route --save --ambient
they are the same package?
Tim Kindberg
@timkindberg
Mar 02 2016 21:21
Router with an 'r'
But that is correct
There is no 'angular-ui-route' without the 'r'
Nathan Erickson
@Luwdo
Mar 02 2016 21:28

ah my typo, alright follow up clarification, both should not be in my packages,

"angular-ui-router": "^0.2.18",
"ui-router": "^1.0.0-alpha0",

and the typings for the ui-router, where would be the best lib to get them from?

meaning ng-forwards @StateConfig needs the ui-router not the angular-ui-router
Typings I'm not sire
Nathan Erickson
@Luwdo
Mar 02 2016 21:37
alright so it is the angular-ui-router package that is preferred package then in https://github.com/ngUpgraders/ng-forward/blob/master/API.md#stateconfig the example uses import uiRouter from 'ui-router'; the implication is that there is a loaded module by that name, am i right in assuming that the references in the ng-forward doc that reference the ui-router package mean to reference angular-ui-router
Tim Kindberg
@timkindberg
Mar 02 2016 21:39
That's a big in the docs I guess :(
Bug*
Should be angular-ui-router
Nathan Erickson
@Luwdo
Mar 02 2016 21:42
alright cool, thank you
Nathan Erickson
@Luwdo
Mar 02 2016 22:22
full of questions today, anyway I noticed that ng-forward has a IComponentState decorator that extends a ng.ui.IState, there is no interface exported for ng.ui.IState within ngforward
I imported the defiantly typed angular-ui-router.d.ts
but it actually declares angular.ui.IState
I can create an alias i believe, but is there a typings doc that ng-forward used to build that interface?
Tim Kindberg
@timkindberg
Mar 02 2016 22:31
We don't export the interface but I would think it would still give you IntelliSense in your IDE when you were filling out the state config properties.
if you need the interface to be exported feel free to submit a pull request and I'll merge it
Nathan Erickson
@Luwdo
Mar 02 2016 23:15
exporting would be good but the other issue is that ng.ui.IState is not defined, so in state-config.d.ts when it calls import IState = ng.ui.IState; ng.ui.IState does not exist