Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scope not correct
Message
 
 
À
08/04/2016 15:19:41
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01634540
Message ID:
01634549
Vues:
30
>>Did you try in the init of your controller (or just at the very top) to use
>>
>>$scope.accountPeriods = [{}];
>>
>>And don't use (declare) that var accountPeriods at all in the service?
>
>same behavior...

When you selecting an environment you're going to another state? Is it a different page?
 var name = $rootScope.$state.current.name;
                    $rootScope.$state.go(name, {
                      environment: p.id
                    });
return false;
If so, the way I solve such problems is to use an extra object, e.g.

$scope.Accounts.accountPeriods = [{}];

and have $scope.Accounts = { accountPeriods: [{}]};

declared in the Init of the top object. And reference it through this extra object.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform