Skip to content

Fails trying to load child state template when parent's ui-view located in an outermost element #198

Closed
@iomico

Description

@iomico

Fails trying to load child state into state's template when ui-view located inside outer element.
Even this state bindings doesn't work in this case - see callBindedFunc().
As I expecting - child state should load it's template into parent's element with ui-view directive.
And why any binding with correspondent $scope in this case fails?

<div ui-view>
        <button ng-click="callBindedFunc()">Call</button>          // Fails!
        <button ng-click="$state.transitionTo('childStateName')">  // Also Fails!
              Go To Child State
        </button>
</div>

but below (in case of ui-view located inside) works fine

<div>
        <button ng-click="callBindedFunc()">Call</button>           // Works !
        <button ng-click="$state.transitionTo('childStateName')">   // Also Works!
              Go To Child State
        </button>

        <div ui-view></div>
</div>

I need to "replace" current state template content (inside outer DIV) with child's state template (as intended in 1st snippet)

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