This repository has been archived by the owner on Jan 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
load into controller? #14
Labels
Comments
Yes, but how to use ? |
I ended up just doing this:
|
Another way:
|
Can this be done in the angular-underscore library? I would like to use it like so: angular.module('myApp', ['angular-underscore'])
.controller('MyCtrl', function($scope, _) {
}); |
It does seem a little silly that you can't just have underscore injected into a controller. @floydsoft would it be reasonable to add in something like this: .constant('_', _) I could submit a PR if you'd accept it. |
@chovy @sandro-csimas @screendriver : Oops, I finally found that I forgot adding document of how to access the underscore utilities from controller, in the current version, the utilities is bound on the angular.module('myApp', ['angular-underscore'])
.controller('MyCtrl', function($scope) {
$scope.sample([1, 2, 3]); // got 1, or 2, or 3.
$scope._([1, 2, 3]); // underscore's chain, http://underscorejs.org/#chain
}); |
@jarcoal PR is welcome! |
Thanks @floydsoft, i will check later! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
How do I load this thing into my controller so I get
_
?The text was updated successfully, but these errors were encountered: