私は、角度の付いた動的に作成されたボタンのメニューを持っています。ボタンを押すと、データが入ったテーブルが表示されます。どのように私はアプリケーションを開くとき、最初のボタンを押すためのデータは、デフォルトで表示されるように?つまり、ボタンを押していないのですか?そして、別のボタンを押したときに変更される値。これは可能ですか?私のコード:角度デフォルトでボタンが自動的に押された角度
<div ng-repeat="group in groups" class="btn-group">
<button type="button" class="btn btn-primary" ng-click="switchGroup(group.id)">{{ '{{ group.code}}' }}</button>
</div>
<div ng-show="repartizations.length == 0"><h2> There is no schedule for this group.</h2></div>
<table class="table table-responsive" ng-show="repartizations.length > 0">
...
</table>
:
$http.get('/api/group/specialization/' + $state.params.valueSpecialization).then(function (success) {
$scope.groups = success.data;
}
);
$scope.switchGroup = function (groupId) {
$http.get(
'/api/repartition/group/' + groupId
).then(function (success) {
$scope.repartizations = success.data;
});
};
私はできる限りあなたの答えを受け入れます。 – IleNea