Photo: JEFFREY NEIRA/?2011 CBS Broadcasting Inc. All Rights Reserved.
As infallible as we like to think The Good Wife is, this week we discovered a topic that the show doesn’t do well: Death. Sure, it has dealt with gruesome murders or the moving last-minute appeal of a death-row inmate (still our favorite episode of the season), but when it came to the death of someone our gang of lawyers actually knows, even their moments of reflection seemed oddly out of place. Every person on this show is a vulture and a survivor. While they may occasionally show signs of vulnerability, mourning and grief are too big and uncontrollable to fit into their vocabulary of emotional expression. Are they incapable of going that deep, or do they just shut down too quickly to process such things?
The episode ends on sad Will asking Tammy not to move to London (some nonsense about her job) so he won’t have to die alone. How romantic! It’s a pretty heavy conclusion to reach, given that the dead party in question, Diane and Will’s former partner Jonas Stern, has been MIA for the entire season. When Stern showed up defending an Internet company that allegedly treated its employees so poorly three of them committed suicide in a month, we had to dig deep into the recesses of our memories to recall why this man seemed vaguely familiar. The show helpfully reminded us that he left the firm and stole half their clients and had been going up against them in court all year. But we’ve never seen these epic Will/Diane/Stern battles. So when Stern fell asleep at his office and never woke up, the whole affair had a very “who cares” kind of air to it.
Normally, we love how this show shies away from the maudlin tendencies of portraying big life events on network TV. Remember Will and Diane digging up those alter kockers and buying their votes to kick Bond out? When one of them dropped dead, Diane merely rolled her eyes and started scheming again. Stern’s death gets a slightly more delicate touch, but not by much. Diane is so gobsmacked by the news she drags her phone off her desk in her haste to grab Will from the hallway (one of many great visual jokes in this episode). Both admit that they immediately starting thinking of ways snatch up their old clients. When Diane tells Will she already made up a list, he looks ready to jump across the desk and kiss her. But what’s the etiquette in client-snatching from a dead man? Is today too gauche? If they wait till tomorrow, will some other, slimier lawyers “without the same sense of restraint” beat them to it? They should probably go visit his family sitting Shiva, right? Should they feel guilty about not feeling guilty about wanting to exploit Stern’s death? It’s classic Good Wife, including the part of the discussion where they break out the scotch and talk about their fears of dying unremarkable deaths alone in the office. “Does it matter? We all end up in the same place. All that’s left is a Wikipedia entry,” says Will, darkly. Deep thoughts. It’s remarkable how they go straight to self-pity without a bit of sorrow over knowing that this person who was a huge part of their lives and their professional rise is now gone forever, even if he had turned into a rival and enemy.
The surface treatment of death continues at Stern’s house, where Will, like seemingly every other lawyer in Chicago, has brought a tub of potato salad for the grieving family. The obvious circling of the waters is pretty funny, and we learn that Stern has sold his firm to Louis Canning (good ol’ sweeps-winning Michael J. Fox). But their complete lack of empathy for the dead man is a little extreme. Look we’re not asking for gravitas here, just an acknowledgment that these characters can view the tangential humans in their lives as humans rather than obstacles or plot devices. For all their troubles, no major character in this show besides Alicia and her kids has had to deal with anything like a real tragedy. How interesting would it be to see one of them confront a problem that was neither of their own creation, nor could be fixed by scheming or just getting tougher and powering through it? Six Feet Under managed to find both the humor and emotional sides of dealing with death, and it’s a little sad that a show that’s as good as this one is working with a color palette limited to reticence, regret, and anger. One nostalgic story about Stern’s sharklike ways and we would have bought Will’s sadness at the end. But nostalgia or affection never comes, and the ending just feels hollow.
As new owner of Stern’s firm, Canning takes over the class action, which started out fascinatingly, with Alicia watching a video of a man walking calmly through a row of cubicles, standing on his desk, throwing an electrical cord over a bar on the ceiling, and hanging himself. What a way to start an episode. But as it progressed, it just dragged on and on and on. Was the firm treating its employees badly so they’d quit and the company wouldn’t have to pay severance? Did the employees get depressed because of their mean bosses or because of personal problems, like a cheating spouse? Or perhaps it was because they were on an anti-depressant that makes people want to kill themselves. Sound familiar? Yeah, Canning once represented that evil drug company, and went up against Lockhart Gardner and lost. This time, he argues that the drug does make employees want to kill themselves and even uses Lockhart Gardner’s evidence from the previous case (a disturbing video of murderous mice on the drug) to prove that the employees killed themselves for factors other than their bosses from hell. It’s a pretty genius strategy. But in the end, Kalinda digs up an employee who can testify not only that this suicide-causing drug was not involved (her friend who killed himself never took it), but also that the firm’s behavior was driven by a need to cut costs after they’d looted $34 million from the company’s pension fund. Will and Alicia use the fraud evidence to force a settlement. Another victory! Eh ….
In theory, we should love this Canning lawyer. After all, we love MJF. But when Canning told Alicia, “Looks like we’ll be seeing a lot more of each other,” we actually groaned. Last time he appeared, in that class action about the tainted water, Canning was an enigma, a man motivated by an intense drive to win and by a love of his wife, and it was really fun sussing out which of his statements were sincere and which weren’t. This time, he just seemed annoying and shady; when every pitch the guy throws is a curveball, it gets boring fast. Again, he bonded with the judge over their family members with Alzheimer’s. Again, he tricked Alicia into doing something nice for him (driving him around) by referencing his disability. Again, he blatantly pandered to jury bias, this time by painting his client as a patriot who only treated her employees harshly because she was afraid she’d have to ship their jobs overseas if they weren’t productive enough. Again, he cryptically alluded to Alicia that she hadn’t won her case, even though she thought she did. We shudder to think of how much of him we’ll have to endure if Alicia accepts his job offer (he made two over the course of the episode). We like the idea of a bidding war for Alicia once she’s wife of the State’s Attorney. Just cool it on the Canning, please.
One person we’d love to see more of, though, is the delightful Denis O’Hare returning as touchy-feely Judge Abernathy. This is a man who quotes Dante’s Inferno (“Tant’ è amara che poco è più morte”) after an imposed moment of silence for Stern, whom he didn’t know. He likes comfy sweaters and makes lawyers sit down before they argue in chambers so that they’ll be less aggressive. How amazing would it be to get an episode told from the perspective of a judge? We’d even settle for a scene of all the show’s wacky judges hanging out in the courthouse break room.
It also looks like we’re going to see plenty more of Tammy. At the beginning of the episode, she tells Will that her job wants to send her to London in two weeks to do on-the-ground reports on the city’s preparation for the Olympics. Will doesn’t beg her to stay, so she leaves. Later, she learns that Will had dumped Tammy’s sister for Alicia back in college and she wants to know if lingering feelings for Alicia are why Will won’t commit. Alicia has an unguarded girlie moment thinking out loud about Will, but assures Tammy that there’s nothing there. Yeah, right. But just when we’re fuming about the return of the will-they-won’t-they, Alicia tells Will about her talk with Tammy and they both seem to agree that they won’t. Cue Will telling Tammy he wants her to stay so he won’t die alone, and Tammy throwing away her career for him on that romantic appeal. Go women’s lib.
One couple we are rooting for, though, is Kalinda and Cary. The buildup of their affection has been so lovely to watch over the season. But it looks like Cary’s continued protection of Kalinda against the interests of his job is going to come around to hurt him. Childs has learned that Matan is sitting on some information from his final interview with Blake. Matan only turned in three pages of a five-page report, and now Childs unleashed daddy detective Wiley to find out what’s in those missing pages. That Childs tells them all this via Wiley’s speakerphone in the shape of a stuffed lion that moves its lips was maybe the best thing we’ve ever seen on this show.
Cary goes to talk to Matan again, who realizes that it’s in both their interests to defy Childs and Wiley and keep the contents of those missing pages a secret. Then, for no good reason, Matan tells Cary about Kalinda’s affair with Peter. Cary then follows Kalinda to relay what he knows, that Matan is not a problem as long as Peter wins, but that Wylie likely won’t rest until he knows what’s in those missing pages. The exchange doesn’t move the plot forward, but we learn two things. One, Kalinda has a huge crush on Cary, judging from the way she lights up when he tells her he’s been following her around town. (It’s so Kalinda to be thrilled about the guy she likes spying on her.) And, two, rather unexpectedly, Cary is in deep enough with his feelings for Kalinda that he cares more about protecting her than about her having slept with Peter. He also brings up an interesting question: Is the affair the reason why Kalinda became friends with Alicia in the first place? It’s a wonderfully honest discussion and we’re pleased with the positive progress in this relationship. But it turns out that Wiley followed Cary as he was following Kalinda, and it seems likely that he’s not as eager as Cary is to sacrifice his job for friendship.
With Peter’s campaign three points up with six days to go, we’ve now reached the moment we knew was coming, when the Kalinda issue threatens to derail the campaign and destroy everyone’s lives in the process. In this home stretch, Eli is, of course, amped and stressed out. The DCC are proving to be, as Wu-Tang would say, a bunch of bitches. They bring suit against Wendy Scott-Carr, charging her with lack of residency in Illinois, which they think is the final blow, but which Eli realizes is a rallying point for her struggling campaign. “You gave her an issue! You gave her a reprieve!” he yells, between choking the DCC dude, questioning his intelligence, turning all manner of shades of red, and throwing out the worst insults he can imagine: “novice” and “amateur.” See, the residency accusation reeks of machine politics and makes it clear that Peter, who has positioned himself as the anti-machine candidate, is very much a part of the machine.
In comes Petra (Lily Rabe), a gleefully nosy reporter. Eli diffuses the residency thing only to discover that Petra is sitting on something much bigger. “Florrick has bimbo issues,” she says with smirk. An anonymous source (Blake, obviously) has told her that Peter slept with a co-worker has actively been trying to hide it from his wife. The only solution is for Alicia to talk to Petra and try to temper the tone of the article by giving calm, measured quotes. “I think the closer we get to an election, the rumor-mongering turns less into a sport and more into a strategy … Voters are often moved by last-minute rumors because there’s no adequate time to refute them. So that’s why they become part of a strategy to hurt your opponent,” says Alicia, doing very well. She tells Petra she refuses to discuss personal conversations between Peter and herself. Then Petra starts going for the kill. “If your husband abused his power and slept with a co-worker, and he lied to the people closest to him, his wife and his children, do you think the electorate should trust him?” Alicia doesn’t answer, but when Petra follows up by asking if Alicia had an AIDS test, it’s Eli who flies off the handle and tells Petra to go to hell. It’s the second time in the episode he’s made an appeal to her based on the very real people behind her rumor-mongering, and one gets the sense that he’s speaking less as a campaign manager than as someone who’s really come to care about this family. That’s emotion done right.
By submitting your email, you agree to our
Terms and Privacy Notice
and to receive email correspondence from us. This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
Already a subscriber?
Already a subscriber?
`;
// integrate Sub(x) scripts and elements
if (hostname !== 'subs.nymag.com') { // do not integrate on this subdomain
document.head.appendChild(trackingScript);
document.body.insertAdjacentHTML('beforeend', subXAnimationElements);
}
There was an error processing the request. Please try again later."}).catch(e=>console.error("Error verifying email: ",e)))(r.querySelector(".content"),o.bannerCTAVerification)})):(l.remove(),s.remove()),o.dismissable||n.remove(),o.useAlertIcon||a.remove(),r.classList.add("show"),n.addEventListener("click",()=>{u(),r.classList.remove("show")})}else r.remove()}});
}, {"3":3,"6":6,"17":17,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(17),signInButton=dom.find(".user-signin"),signOutButton=dom.find(".user-signout"),globalNav=dom.find('[class^="global-nav"]'),body=dom.find("body"),dropdownItems=dom.findAll(".dropdown-wrap"),gtm=require(3),appendLandingPageParams=require(135),pageUri=require(124).getPageUri(),subscriptionPromoLinks=dom.findAll(".persist-params"),searchString=window.location.search||"";function closeDropdowns(e){let n=globalNav.querySelectorAll(".dropdown.open");dropdownItems.forEach(function(t){let i=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||i.classList.remove("open")})}function gtmSendReport(e,n,t){let i={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(i.eventLabel=n.href),gtm.reportNow(i)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const i=t.split("?"),o=new URLSearchParams(i[1]);for(let e of n.entries())o.set(e[0],e[1]);t=`${i[0]}?${o.toString()}`,e.href=t}else e.href=`${t}?${n.toString()}`}}function init(e){const n=e.querySelectorAll(".to-landing-page");window.addEventListener("auth:init",()=>{signInButton.addEventListener("click",function(e){e.preventDefault(),auth.showEmbeddedLoginFlow("top navigation")}),signOutButton.addEventListener("click",function(e){e.preventDefault(),gtmSendReport("Sign Out",e.target,"user-info-link"),auth.logout()}),auth.isAuthenticated()&&e.classList.add("signed-in"),(auth.isSubscriber()||auth.isMobileAppRequest())&&e.classList.add("subscribed"),e.querySelectorAll(".user-link").forEach(e=>{e.classList.add("active")}),subscriptionPromoLinks.forEach(e=>{updateElementTargetUrlsIfQueryStrings(e)}),appendLandingPageParams(n)})}dropdownItems.forEach(function(e){e.addEventListener("click",function(){e.querySelector(".dropdown").classList.toggle("open")})}),body.addEventListener("click",closeDropdowns),document.addEventListener("keydown",closeDropdowns),globalNav.addEventListener("click",function(e){let n=e.target;n.classList.contains("global-nav-track")&>mSendReport(n.text,n,"global-nav-link")}),module.exports=init;
}, {"3":3,"4":4,"17":17,"124":124,"135":135}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(406),Fingerprint2=require(408),DS=require(407),Eventify=require(246);function registerGlobals(){window.DS=DS,window.Eventify=Eventify,window.Fingerprint2=Fingerprint2,DS.value("Eventify",Eventify),DS.value("Fingerprint2",Fingerprint2),DS.value("$document",window.document),DS.value("$window",window)}function mountDollarSliceComponents(){DS.service("components",["$document","$module",function(e,n){var o=_pickBy(n.definitions,e=>e.providerStrategy===n.providers.controller),r=Object.keys(o);function t(e){return o=>{try{n.get(e,o)}catch(e){logMountError(o,e)}}}_each(r,n=>{var o=e.querySelectorAll('[data-uri*="/_components/'+n+'/"]'),r=e.querySelectorAll('[data-uri$="/_components/'+n+'"]');_each(o,t(n)),_each(r,t(n))}),this.components=r}]),DS.get("components")}function logMountError(e,n){const o=e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML));console.error("Error attaching controller to "+o,n)}registerGlobals(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{mountDollarSliceComponents()}):mountDollarSliceComponents();
}, {"221":221,"246":246,"406":406,"407":407,"408":408}];
window.modules["ads.legacy"] = [function(require,module,exports){"use strict";const _map=require(118),_forEach=require(107),_isString=require(268),_intersectionWith=require(409),_isEqual=require(274),_each=require(406),_debounce=require(182),_sortBy=require(205),page=require(124),visit=require(114);DS.service("adService",["Eventify","$cid","$document","$window",function(e,t,a,i){var o,n,s,r,d,c,u,l,g={},p=this,h=[],f=visit.getQueryParamsObject(["utm_campaign"]),m=document.querySelector('script[data-type="ad-a9"]'),b=[],w=!1,v=[],y=document.querySelector('script[data-name="ad-doubleverify"]');document.querySelector('script[data-name="concert-ads"]')||(i.NYM={},i.NYM.analytics={},i.NYM.analytics.adStartTime=i.performance.now(),i.googletag=i.googletag||{},i.googletag.cmd=i.googletag.cmd||[],u=i.googletag,(m||y)&&(i.googletag.cmd=i.googletag.cmd||[],i.googletag.cmd.push(function(){i.googletag.pubads().disableInitialLoad()})),m&&(l=i.setInterval(function(){void 0!==window.apstag&&void 0!==window.apstag.timeout&&(i.clearInterval(l),window.apstag.cleared=!0,l=null)},10),setTimeout(function(){l&&(i.clearInterval(l),i.googletag.pubads().refresh(),window.apstag||console.log("MESSAGE: Timeout for A9 load exceeded, aborting"))},500)),y&&(b.push(new Promise(function(e){w?e():v.push(e)})),c=i.setTimeout(T,2500)),o=function(e){var t,a,o=e.data,n=[];return o.loaded?e:(o.loaded=!0,t=null,(t=o.sizes?u.defineSlot(o.name,o.sizes,o.id).addService(u.pubads()):u.defineOutOfPageSlot(o.name,o.id).addService(u.pubads())).setTargeting("adid",o.id),f.hasOwnProperty("utm_campaign")&&t.setTargeting("utmcamp",f.utm_campaign),a=p.getAdCount(o.label),t.setTargeting("label",o.label+"_"+o.site+"-"+a),u.display(o.id),u.pubads().addEventListener("slotOnload",function(){i.NYM.analytics.firstAdLoadTime||(i.NYM.analytics.firstAdLoadTime=i.performance.now(),i.NYM.analytics.firstAdLoadLabel=e.data.label)}),n=_(o),Promise.all(b).then(function(){n?window.apstag&&window.apstag.cleared?window.apstag.fetchBids({slots:[n],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([t],{changeCorrelator:!1})})}):y&&u.pubads().refresh([t],{changeCorrelator:!1}):u.pubads().refresh([t],{changeCorrelator:!1})}),e.slot=t,e)},n=function(e){var a,i,o,n=t(),s=e.getAttribute("data-name"),r=e.getAttribute("data-sizes"),d=e.getAttribute("data-label"),c=e.getAttribute("data-site");n=e.id,r&&r.length?(r=r.split(","),a=[],_map(r,function(e){e=e.split("x"),i=parseInt(e[0]),o=parseInt(e[1]),a.push([i,o])})):(e.classList.add("oop"),a=!1),this.data={id:n,name:s,sizes:a,loaded:!1,label:d,site:c},g[n]=this},r=function(e){u.cmd.push(function(){var t=o(e);g[e.data.id]=t})},s=function(e){var t=[];e.slot?(t=_(e))&&window.apstag&&window.apstag.cleared&&window.apstag.fetchBids({slots:[t],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([e.slot],{changeCorrelator:!1})})}):e&&r(e)},u.cmd.push(function(){var e,t,o,n=page.getMeta("article:tag"),s=page.getMeta("author"),r=i.location.href,d=(e=a.head.querySelector(".head-gtm"),t=a.body.querySelector(".gtm"),e&&"top"===e.getAttribute("data-gtm")?"gtmtop":t&&"bottom"===t.getAttribute("data-gtm")?"gtmbottom":"");o=[],_forEach([n,s,d],function(e){_forEach(e.split(","),function(e){(e=e.trim().toLowerCase().replace(/\s/g,"-").replace(/\'|\’/g,"")).length&&o.push(e)})}),u.pubads().setTargeting("kw",o),u.pubads().setTargeting("entry_group",o),r=r.slice(r.lastIndexOf("/")+1),u.pubads().setTargeting("pn",r),u.companionAds().setRefreshUnfilledSlots(!0),u.pubads().enableAsyncRendering(),u.enableServices()}),this.load=r,this.create=function(e){return new n(e)},this.refresh=function(e){var t;_isString(e)?(t=this.getById(e),s(t)):s(e)},this.remove=function(e){var t=e.data.id;a.getElementById(t).innerHTML=""},this.getAdCount=function(e){var t,a=0,i=Object.keys(g);return _each(i,function(i){(t=g[i]).data.loaded&&t.data.label===e&&a++}),a},this.getById=function(e){return g[e]},d=_debounce(function(){var e={TopLeaderboard:1,RightColTopMPU:2,outOfPage:99,"homepageTakeover/TopLeaderboard":1},t=_sortBy(h,function(t){return e[t.data.label]||10});_forEach(t,function(e){return e.data.sizes?r(e):i.setTimeout(function(){r(e)},2e3)}),y&&window.PQ.cmd.push(()=>{try{window.PQ.loadSignals(["ids","bsc","vlp"],T)}catch(e){T(),console.error(`There has been an error loading Double Verify signals: ${e}`)}}),h=[]},10),this.addToPageLoadQueue=function(e){h.push(e),d()});function _(e){var t,a=e.sizes;return a=_intersectionWith(a,[[970,250],[970,90],[728,90],[300,600],[300,250],[320,100],[320,50]],_isEqual),e.sizes&&e.sizes.length&&(t={slotID:e.id,sizes:a,slotName:e.label}),t}function T(){i.clearTimeout(c),w=!0,_forEach(v,function(e){e()})}}]);
}, {"107":107,"114":114,"118":118,"124":124,"182":182,"205":205,"268":268,"274":274,"406":406,"409":409}];
window.modules["cid.legacy"] = [function(require,module,exports){"use strict";DS.service("$cid",function(){var r=Math.floor(100*Math.random());return function(){return"cid-"+ ++r}});
}, {}];
window.modules["client.legacy"] = [function(require,module,exports){"use strict";require("cid.legacy"),require("ads.legacy"),require("facebook.legacy"),require("aaa-module-mounting.legacy");
}, {"cid.legacy":"cid.legacy","ads.legacy":"ads.legacy","facebook.legacy":"facebook.legacy","aaa-module-mounting.legacy":"aaa-module-mounting.legacy"}];
window.modules["facebook.legacy"] = [function(require,module,exports){"use strict";DS.service("facebook",[function(){this.fb=function(i){window.FB&&window.FB[i].apply(this,Array.prototype.slice.call(arguments,1))}}]);
}, {}];
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o typeof key === 'string' && key.match(/\.legacy$/)).forEach(key => window.require(key));
}
function tryToMount(fn, el, name) {
try {
fn(el); // init the controller
} catch (e) {
const elementTag = el.outerHTML.slice(0, el.outerHTML.indexOf(el.innerHTML));
console.error(`Error initializing controller for "${name}" on "${elementTag}"`, e);
}
}
/**
* mount client.js component controllers
*/
function mountComponentModules() {
Object.keys(window.modules).filter(key => typeof key === 'string' && key.match(/\.client$/)).forEach(key => {
let controllerFn = window.require(key);
if (typeof controllerFn === 'function') {
const name = key.replace('.client', ''),
instancesSelector = `[data-uri*="_components/${name}/"]`,
defaultSelector = `[data-uri$="_components${name}"]`,
instances = document.querySelectorAll(instancesSelector),
defaults = document.querySelectorAll(defaultSelector);
for (let el of instances) {
tryToMount(controllerFn, el, name);
}
for (let el of defaults) {
tryToMount(controllerFn, el, name);
}
}
});
}
// Make sure that a `window.process.env.NODE_ENV` is available in the client for any dependencies,
// services, or components that could require it
// note: the `` value is swapped for the actual environment variable in /lib/cmd/compile/scripts.js
window.process = window.process || {};
window.process.env = window.process.env || {};
if (!window.process.env.NODE_ENV) {
window.process.env.NODE_ENV = '';
}
// note: legacy controllers that require legacy services (e.g. dollar-slice) must
// wait for DOMContentLoaded to initialize themselves, as the files themselves must be mounted first
mountLegacyServices();
mountComponentModules();
// ]]