Skip to content

Instantly share code, notes, and snippets.

@gerardvcruz
Created May 12, 2016 06:10
Show Gist options
  • Save gerardvcruz/bd82dd37b5b8af2d3b19788c9aff0a91 to your computer and use it in GitHub Desktop.
Save gerardvcruz/bd82dd37b5b8af2d3b19788c9aff0a91 to your computer and use it in GitHub Desktop.
// <input ng-model="foobar">
// $scope.foobar is an object with attribute 'baz'
$scope.foo = _.map($scope.barArray, function(bar) {
if(bar.baz === $scope.foobar.baz) {
return bar;
}
});
// after uglifying, i cannot access $scope.foobar.baz in the _.map anymore
// the error is something like 'Undefined method or variable baz for null'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment