Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

lodash as DI service #10

@RopoMen

Description

@RopoMen

Hi,

It would be nice if you could also add '' service as well. Even though lodash functions are available in $scope it would be nicer to have '' service in this module as well. Currently I need make that service to all projects, becasue I don't want to write $scope everytime I use lodash inside controller AND I don't want to use global '_' neither.

if('_'.length < '$scope'.length) console.log('This would be nicer to use inside controller :)');

Adding service:

.factory('_', ['$window', function($window) {
  return $window._;
}]);

and jsfiddle from that http://jsfiddle.net/RopoMen/c2sgLjou/

Br,
Markku Roponen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions