首页 > 解决方案 > 设置限制的分页方法在 Angular 2 中不起作用

问题描述

setLimit(limit){
        this.maxLimitMessage=false;
        if(limit>=101)
            this.maxLimitMessage=true;            
            this.toastsManager.error("max limit cannot be more than 100",limit, this.limit);            
            this.limit=100;            
            return;
        }        
        this.toastsManager.error('vbnm')
        this.limit = limit;                        
    }

在这种方法中,我希望如果值大于 100,则自动更大的值将等于 100。但在这种情况下,它不起作用。

标签: angular

解决方案


推荐阅读