Skip to content

Dynamic ui-view name no longer working in v0.2.8 #825

@gabrielmaldi

Description

@gabrielmaldi

In v0.2.0, I could do:

<ui-view name="{{ 'mainContainer_' + page.route }}" ng-repeat="page in pages"></ui-view>

But this doesn't work anymore in v0.2.8.

I investigated a little and found that the name is assigned in lines 2211-2218 (looking at https://github.com/angular-ui/ui-router/blob/master/release/angular-ui-router.js):

var currentScope, currentEl, viewLocals,
name      = attrs[directive.name] || attrs.name || '',
onloadExp = attrs.onload || '',
autoscrollExp = attrs.autoscroll,
renderer  = getRenderer(element, attrs, $scope);

if (name.indexOf('@') < 0) name = name + '@' + (inherited ? inherited.state.name : '');
var view = { name: name, state: null };

I tried using $interpolate there, and the name is interpolated correctly. However, the ui-views come up empty. If I remove the ng-repeat and add each ui-view separately with its respective name, everything works fine.

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