可以为WayPoints插件使用AngularUI jQuery PassThrough吗?

pht*_*ven 5 jquery jquery-waypoints angularjs

我打算尝试为这个jQuery WayPoints插件编写一个指令http://imakewebthings.com/jquery-waypoints/#documentation

但随后发现了使用jQuery Passthrough的AngularUI,声称支持75%的jQuery插件. http://angular-ui.github.com/

有人可以写一个如何在我的AngularJS应用程序中使用这个jQuery WayPoints插件的例子吗?

Glo*_*opy 13

这是一个小提琴似乎使用AngularUI jQuery Passthrough和Waypoints.需要注意的主要事项是:

1)包括angular-ui.js脚本(这是一个非常棒的AngularJS伴侣!)

2)['ui']注册模块时添加requires参数

angular.module('waypoints', ['ui']);
Run Code Online (Sandbox Code Playgroud)

3)在路径被击中时,在控制器中添加要调用的功能

function WaypointsController($scope) {
    $scope.test = function(){
        alert('you have scrolled');
    }
}?
Run Code Online (Sandbox Code Playgroud)

4)设置ui-jq将函数传递给的指令ui-options

<div ui-jq="waypoint" ui-options="test">
Run Code Online (Sandbox Code Playgroud)