Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 26 20:36
    john-dent commented #88
  • Jun 26 20:35
    john-dent commented #88
  • Mar 19 22:58
    gmostert closed #244
  • Feb 08 06:53
    OliverWall commented #251
  • Dec 14 2018 08:06
    fadehelix commented #251
  • Dec 14 2018 05:03
    thematho commented #251
  • Dec 14 2018 05:01
    thematho commented #209
  • Dec 14 2018 04:59
    thematho commented #209
  • Dec 12 2018 21:57
    fadehelix synchronize #251
  • Nov 04 2018 23:35
    thematho synchronize #224
  • Oct 26 2018 16:00
    Stephanemw commented #248
  • Oct 26 2018 00:16
    thematho synchronize #224
  • Oct 16 2018 11:11
    caprica-Six commented #148
  • Oct 16 2018 11:11
    caprica-Six commented #148
  • Oct 16 2018 11:10
    caprica-Six commented #148
  • Oct 16 2018 11:08
    caprica-Six commented #148
  • Oct 16 2018 11:07
    caprica-Six commented #148
  • Oct 09 2018 00:35
    thematho commented #251
  • Sep 16 2018 13:27
    scriptrance commented #114
  • Sep 14 2018 23:22
    KiranChaudhariJM commented #114
Sergey Protko
@fesor
@kinabalu promises?
I use uiRouter’s resolvers and try to never get data from components
Andrew Lombardi
@kinabalu
@fesor oh, shit… yeah … forgot about that
@fesor refactoring is fun and illuminating so very often
@fesor do you have any examples of doing this? I think I may just google around to see if I find something, or see if it’s in the todo app
Sergey Protko
@fesor
todoapp is single screen app… I don’t see how I can add something like that.
I tried to find some more complex applications and didn’t found anything useful
Andrew Lombardi
@kinabalu
hrmm bummer, ok
Sergey Protko
@fesor
I had a crazy idea of writting UI for jenkins CI in angular))
Andrew Lombardi
@kinabalu
that’s … ambitious
but warranted, jenkins CI is quite shitty
Sergey Protko
@fesor
no, managing part like jenkins configuration would stay as it is. Only list of jobs, simplify jobs configurations and so on.
but I just had no time for such projects (
Andrew Lombardi
@kinabalu
yeah, i know the feeling
@fesor when using resolve, will the object be added to this?
Sergey Protko
@fesor
@kinabalu … are you talking about binding values to component controller?
Andrew Lombardi
@kinabalu
@fesor yeah, i’d like to use values that are promise based inside the controller and move ‘em out to resolve like had mentioned
Sergey Protko
@fesor
.state(’stateName’, {
     resolvers: {
          someData: someDataResolver 
     },
     controller: function ($scope, someData) {
         $scope.$resolves = {someData};
     },
     template: `<my-component some-data=“$resolves.someData”></my-component>`
})
Andrew Lombardi
@kinabalu
ahh I thought it was just resolve: { someData: someDataResolver }
and I actually thought using $scope wasn’t really done with NG6-starter
Sergey Protko
@fesor
@kinabalu yeah… I hate to use $scope… but uiRouter doesnt support auto-export resolved data to $scope so i need to handle it mannually
maybe in 1.0
ngRoute does it automaticly
Andrew Lombardi
@kinabalu
ngRoute is a bit more painful to use though, no? that’s why everyone kinda defers to ui-router
Sergey Protko
@fesor
well… it just doesn’t support nested views which makes uiRouter defacto stanrad solution
there is also angular-router, which should be cool… but I didn’t tried it yet
Andrew Lombardi
@kinabalu
@fesor is it possible to inject a service into the resolver flow? ordinarily I’d obviously have a class and use “ngInject”; in the constructor
Sergey Protko
@fesor
yes
resolves: {
    someData: function(someService) {
         return someService.getSomeData();
    }
}
Andrew Lombardi
@kinabalu
ahh and would you use “ngInject” within the function, or is it done automagically?
Sergey Protko
@fesor
well… can’t tell you) I just add ”ngInject” always)
just to be sure)
Andrew Lombardi
@kinabalu
haha
Andrew Lombardi
@kinabalu
@fesor trying to make the resolve stuff work, and ran into a slight issue:
        .state('accountsViewInfo', {
            url: '/accounts/info/:accountID',
            template: '<detail></detail>',
            resolve: {
                account: function($stateParams, accountService) {
                    "ngInject";
                    return accountService.getAccountById($stateParams.accountID);
                }
            }
        })

if I pass into the controller: account

    constructor($stateParams, $localStorage, accountService, account) {
        "ngInject";
        var self = this;
        this.accountService = accountService;

i get a can’t resolve provider error

Sergey Protko
@fesor
resolved values available only on the same level as state definition. components doesn’t know anything about it. That’s why I pass data to scope and then pass it to component’s controller via bindings
and that’s wahy uiRouter suck at it)
Andrew Lombardi
@kinabalu
@fesor could I trouble you for an example of bindings?
@fesor is that what you were doing in that example you pasted?
gah, nevermind I see it now
kinabalu @kinabalu is dense today
@kinabalu i think it is possible to make $stateChangeSuccess listener and update scope values from it… need to investigate this a little bit. Or just add PR to uiRouter
Andrew Lombardi
@kinabalu
@fesor that all worked great btw, thank you. going to work it into the refactor tonight / tomorrw
Diogo Afonso Barroso
@icylabsDev
hey guys I have a question. =) Can I use ng-include without $parent? ng-include creates a scope of its own. Can I pass in bindings?
Sergey Protko
@fesor
@icylabsDev it isn’t isolated, so yes.
Diogo Afonso Barroso
@icylabsDev
it isn't?
ok
i tought it was...
Sergey Protko
@fesor
it just inherited from parent