Skip to content

ng-show does not work with ui-view in v0.2.8 #867

@gabrielmaldi

Description

@gabrielmaldi

It seems that we can't use ng-show on a ui-view in v0.2.8.

Given the following:

<div ng-app="myApp">
    ui-view does not play well with ng-show:

    <ui-view name="main" ng-show="showView"></ui-view>
</div>
angular
    .module("myApp", ["ui.router"])
    .config(function ($stateProvider, $urlRouterProvider) {
        $urlRouterProvider.otherwise("/state1");

        $stateProvider
            .state("state1", {
                url: "",
                views: {
                    "main": {
                        template: "This won't be visible when using ng-show, even though showView = {{ showView }}",
                        controller: function ($scope) {
                            $scope.showView = true;
                        }
                    }
                }
            });
    });

The class ng-hide is always applied to the ui-view, and it is not an issue with the value of showView, because this is what the ui-view ends up containing:

<span class="ng-scope ng-binding">This won't be visible when using ng-show, even though showView = true</span>

Fiddle: http://jsfiddle.net/VhNLX

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions