Last active
December 11, 2015 11:39
-
-
Save BernhardPosselt/4595335 to your computer and use it in GitHub Desktop.
Pimple vs AngularJS dependency injection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP pimple | |
$container = new Pimple(); | |
$container['ActiveFeed'] = $container->share(function($c){ | |
return new MyActiveFeed($c['MyModel'], $c['TestService']); | |
}); | |
// angularjs | |
angular.module('News').factory 'ActiveFeed', ['MyModel', 'TestService', (MyModel, TestService)-> | |
return new MyActiveFeed(MyModel, TestService) | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment