Fix for #598. Angular doesn't seem to like scoped function expressions for the min or max attributes in a number input. Also defaulting maxPages() to return 1 if maxRows is 0.
Merge pull request #682 from chiefy/upstream

Fix for #598.