Use underscore inside Angular controllers

前端 未结 6 1150
轮回少年
轮回少年 2020-11-30 16:16

How do I use underscore library inside angularjs controllers?

On this post: AngularJS limitTo by last 2 records somebody suggested to assign an _ variable to the ro

6条回答
  •  鱼传尺愫
    2020-11-30 16:57

    If you don't mind using lodash try out https://github.com/rockabox/ng-lodash it wraps lodash completely so it is the only dependency and you don't need to load any other script files such as lodash.

    Lodash is completely off of the window scope and no "hoping" that it's been loaded prior to your module.

提交回复
热议问题