SHARE
TWEET
Untitled
a guest
Sep 29th, 2016
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- function testOne(servicea, serviceb) {
- // body
- }
- Try console.log(testOne.toString()). Angular will use a regex to pull out 'servicea' and 'serviceb' from the paramters.
- /** Minified
- function a(b, c) {
- // Note that b and c are NOT the original paramter names, so toString will not work as expected, since b and c are not services!!
- // body
- }
- */
- var testTwoArray = [servicec, serviced, function testTwo(c, d) {
- // c and d refer to servicec, serviced since the array syntax has a higher priority over bare function
- // body
- }];
- app.controller("testOne", testOne)
- app.controller("testTwo", testTwoArray) Cheaper to compute since the names are provided, also works in production
- https://github.com/angular/angular.js/blob/master/src/auto/injector.js#L45
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
