>>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