Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple states for one page without reloading other views #918

Closed
MikeBazhenov opened this issue Feb 27, 2014 · 1 comment
Closed

Multiple states for one page without reloading other views #918

MikeBazhenov opened this issue Feb 27, 2014 · 1 comment

Comments

@MikeBazhenov
Copy link

Hello!
I do dinamycaly update 1 view of 5 views, and other 4 views also updated :(
And I do not want reload other ui-view.

Example

<div class="b-column b-column_size_12 b-column_type_content" ui-view>
<!-- ui-view-anchor -->
<article class="b-article ng-scope" ui-view="work">
 </article>
<!-- ui-view-anchor -->
<article class="b-article ng-scope" ui-view="olympiad">
</article>
<!-- ui-view-anchor -->
<article class="b-article ng-scope" ui-view="sport">
</article>
<!-- ui-view-anchor -->
<article class="b-article ng-scope" ui-view="contest">
</article>
</div>
app.config(function($stateProvider) {
    $stateProvider
        .state('profile', {
            abstract: true,
            templateUrl: '/templates/profile/profile.html',
            controller: function($scope, $http, $state){
                $scope.user = getProfileId();

                $http.get('/api/sport/get/by/'+$scope.user+'/').success(function(data) {
                    $scope.sport_groups = groupWrapper(data,3);
                });
                $http.get('/api/olympiad/get/by/'+$scope.user+'/').success(function(data) {
                    $scope.olympiad_groups = groupWrapper(data,3);
                });
                $http.get('/api/contest/get/by/'+$scope.user+'/').success(function(data) {
                    $scope.contest_groups = groupWrapper(data,3);
                });
                $http.get('/api/work/get/by/'+$scope.user+'/').success(function(data) {
                    $scope.work_groups = groupWrapper(data,3);
                });
            }
        })
        .state('profile.works', {
            url: "/work/get/all/by/{id}/",
            views: {
                "work": {
                    templateUrl: '/templates/profile/work.html',
                    controller: function($scope,$http) {
                        $http.get('/api/work/get/all/by/'+$scope.user+'/').success(function(data) {
                            $scope.work_groups = groupWrapper(data,3);
                        });
                    }
                },
            }
        }).state('profile.olympiads', {
            url: "/olympiad/get/all/by/{id}/",
            views: {
                "olympiad": {
                    templateUrl: '/templates/profile/olympiad.html',
                    controller: function($scope,$http) {
                        $http.get('/api/olympiad/get/all/by/'+$scope.user+'/').success(function(data) {
                            $scope.olympiad_groups = groupWrapper(data,3);
                        });
                    }
                }
            }
        }).state('profile.sport', {
            url: "/sport/get/all/by/{id}/",
            views: {
                "sport": {
                    templateUrl: '/templates/profile/sport.html',
                    controller: function($scope,$http) {
                        $http.get('/api/sport/get/all/by/'+$scope.user+'/').success(function(data) {
                            $scope.sport_groups = groupWrapper(data,3);
                        });
                    }
                }
            }
        }).state('profile.contest', {
            url: "/contest/get/all/by/{id}/",
            views: {
                "contest": {
                    templateUrl: '/templates/profile/contest.html',
                    controller: function($scope,$http) {
                        $http.get('/api/contest/get/all/by/'+$scope.user+'/').success(function(data) {
                            $scope.contest_groups = groupWrapper(data,3);
                        });
                    }
                }
            }
        });
});

Example link http://xn--24-mlclq4bf6a1c.xn--p1ai/profile/52f1e42413be469348948419/

@timkindberg
Copy link
Contributor

That's not currently possible check out issue #894. Which is working on essentially what you're going to need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants