Skip to content

[1.2 branch] Can't update ng-class in ui-view #621

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

Closed
ndesorden opened this issue Dec 2, 2013 · 4 comments
Closed

[1.2 branch] Can't update ng-class in ui-view #621

ndesorden opened this issue Dec 2, 2013 · 4 comments

Comments

@ndesorden
Copy link

Hi,

If i've a ui-view like this:

<section id="main" ui-view="main" ng-class="slide.direction"></section>

At app.ctrl i can bind property slide.direction to class ui-view:

$scope.slide.direction = ""; // or whatever

But at view controller doesn't work. I can update css class inside view template but NOT at section ui-view:

.state( 'test', {
            url: '/test',
            views: {
                "main": {
                    controller: 'TestCtrl',
                    templateUrl: 'test.tpl.html'
                }
            }
        })

 .controller ('TestCtrl', function TestController ( $scope, $filter, $state) {
   $scope.slide.direction = "slide-left";
 }

Inside view template (in test.tpl.html) it works.

<div id="here-it-works" class="slide-left" ng-class="slide.direction">It works!</div>

But ui-view remains without class:

<section id="main" ui-view="main" class="" ng-class="slide.direction"></section>

The idea is change slide direction (so change dinamically css slide-left/slide-right at ui-view) if user click differents buttons.

Sorry by my english

@nateabele
Copy link
Contributor

Plunkr?

@dlukez
Copy link
Contributor

dlukez commented Dec 2, 2013

Also see #320 (comment) and #514

@nateabele
Copy link
Contributor

This looks like a duplicate. @dlukez Let me know if I missed anything.

@ndesorden
Copy link
Author

Yes, sorry, duplicated

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

3 participants