0
我希望當我移動視圖並返回時,我選擇的選擇保持選定狀態。角度選擇請記住,當通過視圖移動
這裏是視圖:
<select ng-model="getseason" class="form-control" ng-options="season as 'Season '+ season + '/' + seasonaddone(season) for season in seasons">
這裏是控制器:
$scope.seasons = [2014,2013,2012,2011,2010,2009,2008,2007,2006,2005];
$scope.getseason = $scope.seasons[0];
$scope.$watch('getseason',function(){
var url = 'http://api.football-data.org/alpha/soccerseasons/?season=' + $scope.getseason;
apiDataService.GetData(url).then(function(data) {
$scope.leagues = data;
});
});
我知道,當我去從另一種觀點回來,再此控制器負載和設定值來season[0]
。
tnx,我解決了服務問題...... – user3590094