stackfull / angular-virtual-scroll

Source for the sf.virtualScroll module for AngularJS
MIT License
262 stars 42 forks source link

Guard variable before use in sfVirtualRepeatWatchExpression #20

Closed markkra closed 10 years ago

markkra commented 10 years ago

I had to tweak sfVirtualRepeatWatchExpression locally for times when coll is undefined:

        function sfVirtualRepeatWatchExpression(scope){
          var coll = scope.$eval(ident.collection);
          if( coll && (coll.length !== state.total) ){
            state.total = coll.length;
            recomputeActive();
          }
          return {
            start: state.firstActive,
            active: state.active,
            len: coll && coll.length || 0;
          };
        }
stackfull commented 10 years ago

good idea, thanks.

stackfull commented 10 years ago

This should be in 6.1 now (which I previously forgot to push the tag for!)