如何在控制器中为angularJS中的视图进行换行

时间:2018-01-31 09:22:14

标签: angularjs

我想像下面的代码一样使用<ScrollViewer> <ScrollViewer.TopHeader> <Grid Width="800" Height="75" Background="Green" /> </ScrollViewer.TopHeader> <StackPanel HorizontalAlignment="Left" VerticalAlignment="Top"> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> <TextBlock Text="hello" FontSize="75" /> </StackPanel> </ScrollViewer> ,是否可能?

parentController

1 个答案:

答案 0 :(得分:0)

是的,但你需要一个父州。例如;

$stateProvider
    .state('main', {
        template: '<ui-view/>',
        controller: 'ParentController as parentCtrl'
    })
    .state('main.base', {
        // your views
    });

如果您有视图,则控制器不能处于相同状态,但您始终可以在层次结构中添加状态以获得相同的结果。