如何在ng-repeat中使用anchorScroll()在索引x上具有start视图

时间:2022-11-25 17:52:11

I am trying to list all minutes in 24 hours duration with a step of 15 minutes.
So, I have these minutes lists in array and looping them using ng-repeat.
In my case, when page is loaded I would like to show list from 07:30 as top, but if I scroll up it must be able to show 07:15, 07:00...

我试着列出24小时内的所有时间,每一步15分钟。因此,我在数组中有这些分钟列表并使用ng-repeat对它们进行循环。在我的例子中,当页面加载时,我希望显示列表从07:30开始,但是如果向上滚动,它必须显示07:15,07:00…

I tried to use filter: 'after', it shows from 07:30 but not before 07:15, 07:00...

我试着使用filter:“after”,它显示的是07:30,而不是07:15,07:00…

Is there a way the ng-repeat starts showing from element 07:30?

是否有办法让ng-repeat从元素07:30开始显示?

I have created a plunker with what I have tried.

我用我试过的东西做了一个活塞。

Any help please, thanks in advance.

有什么需要帮忙的吗?

1 个解决方案

#1


3  

Here is the working plunker

这是工作柱塞

  $scope.goto = function (){
    $timeout(function() {
            $location.hash(30);
            $anchorScroll();
        });
  }

Use $timeout :-)

使用$超时:-)

#1


3  

Here is the working plunker

这是工作柱塞

  $scope.goto = function (){
    $timeout(function() {
            $location.hash(30);
            $anchorScroll();
        });
  }

Use $timeout :-)

使用$超时:-)