diff --git a/README.md b/README.md index 81fbab6..e137791 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,62 @@ Live Demo: http://fdim.github.io/ng-pull/example/ As simple as "bower install ng-pull" :) ## usage -todo -Have a look at examples to see this module in action. +To use this pull gesture, simply add on-pull-(down|up|left|right) attribute with an expression to execute when progress reaches 100%. If expression evaluates to false, item will remain pushed until $reset function is invoked. + + +``` +
+
+
+
{{$pullDownProgress|number:2}}
+
{{$pullDownProgress==100?'Release to request new items':'Pull down to refresh'}}
+
+
+ + + +
+
{{$pullUpProgress|number:2}}
+
{{$pullUpProgress==100?'Release to begin loading':'Pull down to load more'}}
+
Please wait, loading
+
+
+ +``` + +Have a look at the example for more details. + +## options +You can customise behavior by providing additional attributes: +* pull-(down|up|left|right)-distance : number of pixels user has to move the element in order to trigger the expression. Default:100 +* pull-(down|up|left|right)-progress : scope variable name to store progress value. Default: $pull(Down|Up|Left|right)Progress +* pull-(down|up|left|right)-threshold : progress value to cancel the gesture if it is not reached within timeout. Default: 5 +* pull-(down|up|left|right)-timeout : number of ms given for the user to reach threshold value or gesture will be cancelled. Default: 300 +* pull-(down|up|left|right)-disabled : an expression to watch to enable or disable gesture +* pull-(down|up|left|right)-reset : scope variable name to expose reset function. Default: $pull(Down|Up|Left|right)Reset + +Note that directive are not using isolated scope.