The Christmas Spirit: Part One / The Christmas Spirit: Part Two
Season 2
Episodes 9 - 10
Editor’s Rating
5 stars
*****
Photo: Bertrand Calmeau/CBS
It’s the most wonderful time of the year! No, I’m not talking about Christmas or Hanukkah or New Year’s Eve or anything like that. I’m talking about Ghostmas. Ghostmas has traditions I can really get behind. These include (but are not limited to) possessions, resurrections, holiday rom-com plotting, kissing, weepy gift opening, people shoving full sticks of butter down their gullets, sexy lumberjack videos, ghost carolers, and 30 seconds of television that will make you involuntarily jump out of your seat with delightful shock. Warm up a hot toddy and put on your flannel PJs, because that’s a holiday right there.
It feels good and right that Ghosts is leaning into the holiday rom-com theme since Rose McIver stars as a blogger turned queen of Aldovia in not one but three A Christmas Prince movies. It’s a fun little wink to have Sam obsessed with holiday romance — she’s quite adamant that Holly’s making the right choice by quitting her big-city job to marry the heir to the North Pole fortune in Single and Ready to Kringle, which is totally made up but sounds like it could be premiering on Hallmark this very weekend, doesn’t it? But this obsession spirals into something much bigger in our Ghostmas two-parter.
When Jay’s sister, Bela (who, you’ll remember, knows all about the ghosts since Trevor catfished her that one time), arrives for the holidays with her friend Eric, who is clearly in love with her, Sam wants to orchestrate her very own holiday rom-com. She tries to get Bela and Eric in the mood by forcing them into holiday activities, like making gingerbread houses together, and situations that appeal to Bela’s horniness, like trying to get Eric to chop some wood in flannel and suspenders (he does not). Unfortunately, Bela just isn’t into Eric because he’s too much of a nice guy. He’s an architect who designs new hospital wings, helps Bela move whenever she needs it (four times!), and gives up his holiday plans to drive her to Jay and Sam’s when her car gets booted. Eric is a monster, clearly.
Bela wants someone a little more dangerous. Someone a little unpredictable. Someone like … Trevor. Yep, she’s still curious about her ghost match, and, not surprisingly since Trevor hasn’t gotten laid in decades, he remains curious about her, too. Okay, fine, he’s interested in Bela for more than that. They share many common interests, including Hamptons party culture. Whatever — these two are hot for each other!
After seeing Trevor mope around over Bela and Eric (“What does he have that I don’t? A body? Big whoop!”), Sas has an idea. Thanks to Hetty’s excursion into Jay’s body via electrical shock last season, they know that it’s possible for a ghost to possess the living. They also know that Eric would literally do anything for Bela. (Seriously, Bela seems cool and all, but the guy needs to learn how to say no!) What if, the ghosts posit, Trevor uses his ghost power to text Bela from Sam and Jay’s iPad, letting her know about the whole possession thing, and then have her get Eric to agree to let Trevor possess him just for one day so Trevor and Bela can be together? It’s a fool-proof plan!
Just kidding, it is the least fool-proof plan imaginable. Although, the part that you’d think would be the hardest — convincing an adult man that not only are ghosts real, but that he should let a ghost enter his body so that the ghost can have sex with the woman he’s pining after — is actually the easiest. Eric is a little concerned about the whole voluntary high-voltage part, but he wants Bela to “sow [her] wild ghosts” in hopes that one day they’ll be more than friends. This poor, dumb man. Trevor and Sas can’t believe they pulled it off but Trevor does acknowledge what we’re all thinking: “This guy is mentally ill, but I love him!”
Sadly, just as Eric is about to touch the wall sconce’s exposed wiring, which should shoot him back toward Trevor, Sam and Jay figure out what’s going on and put a stop to it. Jay and Bela argue over her terrible life choices. Bela tries to explain that she, Eric, and Trevor “are three consenting adults,” but Jay won’t hear it. He doesn’t think it’s an out-of-line thing to ask that his sister not “sleep with a ghost on Christmas in my house.” Objectively, no, it doesn’t seem like a wild ask, but he is a little harsh about Bela’s decision-making skills. Or is he? I mean, this is a pretty bad decision!
Sadly, Trevor’s hopes for a day with Bela are crushed. “It would’ve been the second greatest thing a Jew ever did on Hanukkah,” he laments to his ghost friends,. “It would’ve been the Maccabees and then T-Money.” Oh Trevor, never change.
But wait! What’s this? Maybe Trevor’s Hanukkah dreams aren’t completely hopeless. On Christmas morning, Sam comes downstairs to kick off her favorite day of the year and continue an ongoing fight she’s been having with Thor who, as it turns out, is not a fan of the holiday that’s made up of a whole bunch of traditions from Norse culture that were taken and tweaked. You think Thor hates Danes? Wait until you hear Thor talk about Christmas.
What all of this means, though, is that Thor is right there behind Sam as she tries to fix the wall sconce — in the perfect position to accidentally possess Sam when she’s zapped and tossed back from the wall. There are two things I love about this turn of events: First, for the second time this season, Rose McIver reminds us why iZombie was so much fun to watch as she completely inhabits our resident Viking. And second, the show recognizes how absolutely bonkers it is that Jay doesn’t notice something’s up with his wife. You can try and cover by having Jay say he’s preoccupied, but the woman is using wild syntax, shoveling butter and fish in her face, and mostly grunting — no one’s buying Jay’s obliviousness, not even the characters in the show. And you know what? It’s fine! Let this wacky sitcom live!
Thanks to some advice from resident possession expert Hetty, Thor is able to stay in control of Sam’s body. In a previous recap, I mentioned that Rebecca Wisocky might be taking the MVP title this season and that distinction becomes official in this episode: Anyone who can get through the line “By the end of my time inside Jay, I had learned to fully suppress the host” without dying (no offense) of laughter, wins it all. Once he gets the doors-are-now-solid thing down, Thor has a grand old time in a living body after 1,000 years as a ghost. Plus his ghost power still works, so he can mess with all the dumb, offensive Christmas lights he wants. The other ghosts use this opportunity to their advantage, too: They have Thor-as-Sam convince Jay that he was too hard on his sister and encourage him to run off to catch Eric at the train station (yes, this man left his own car for Bela to use — somebody help him).
It’s a great “rom-com trope turned on its head” sort of scene when Jay tracks down Eric and woos him back to the mansion with a conversation that would seem highly suggestive to anyone not in the know about possessions. Jay apologizes for being “too judgmental about the thing [Eric] wanted to do with [his] sister last night.” When Eric asks Jay if “it,” meaning possession, is going to hurt, Jay responds: “Honestly, yeah man, a little bit, but once they’re fully inside, it’s not that bad.” The man at the train station overhearing all of this is not enthused, but the rest of us? This is some real “get sucked off” level of humor, and that is among the highest of compliments.
So Trevor and Bela — and weirdly, Eric — should get their Christmas wish, right? Not so fast. Eric touches the exposed wire, gets shocked, and instead of being thrown back into Trevor, Eric dies. He dies! He got electrocuted! But don’t worry, Eric’s story isn’t that tragic — he winds up hanging with the ghosts for a few seconds, long enough for them to let him know that he’s going to regret putting that reindeer sweater on today, but then Thor-as-Sam steps in and uses his electrical powers (while outing himself to Jay) to shock Eric back to life. In the end, Jay drives his wife’s body through the ghost boundary to finally eject Thor, and Bela, thanks to a nudge from Jay about how “unstable” and unpredictable Eric is, begins to see Eric in a new way. While it pains Trevor, it looks like Bela and Eric are headed toward something more than friendship. And all it took was Eric dying and coming back to life to make it happen! Single people, take note!
Bela’s isn’t the only revelation of the holiday. Isaac’s been stewing over a hiccup in his relationship with Nigel: The two haven’t even kissed yet, and that is 100 percent Isaac’s fault. Sure, you could blame his hesitation on the cautionary tale that is Pete getting face-palmed by Alberta last week (the talk of the ghost town), but it’s much more than that. Thanks to an insightful nightmare and some heart-to-hearts with his ghost buddies, Isaac realizes that he’s carrying immense guilt from trapping his wife Beatrice in a sham marriage all those years ago. He feels like he should never be allowed to be happy because he robbed her of her own happiness. But when Sas learns that Beatrice’s nickname for Isaac was Cricket, he puts a few things together: He was around while Isaac was dying and he saw a woman come to Isaac’s bedside to give him clean clothes and be with him in his final moments and the woman called Isaac “Cricket.” It was Beatrice. Even though she must have known that their marriage was built on a lie, it’s clear she forgave Isaac and still cared for him. Knowing this, Isaac can move on from his guilt — and the first thing he does is march into Nigel’s shed and plant a big ol’ kiss on him. It’s very romantic! All holidays should have 100 percent more kissing!
Meanwhile, Thor gains some new perspective too: While in Sam’s body, he learns that there are a few things about Christmas that are actually pretty nice. They’re mostly food related, but also the idea of family and friends coming together. When Pete points out that the ghosts and Sam and Jay are his pseudo-family, that cold, icy Viking heart starts to melt. And then when he learns that Sam got all the ghosts presents and his is a little Viking ship in a bottle? Well, both a Viking and a recapper get a little misty eyed.
Finally, there’s nothing like being horny during the holidays to force a change in perspective. In perhaps the most surprising 30 seconds of Ghosts ever, sad, horned-up Trevor comes across Hetty, who, after being introduced to those hot-lumberjack TikToks before Sam took her phone away from her for good, is also sad and horned up. They both agree that it’s torturous to be this revved up with nothing to do about it. It seems like they are just getting hornier by the second as they trade back and forths. And then just when Trevor thinks he’s been a little too inappropriate with the buttoned-up Hetty, she grabs him and says, “Not nearly far enough, you pantless son of a bitch, get over here” AND THEY START MAKING OUT. Hetty and Trevor! Are! Hooking up! I don’t know about you guys, but this might be the best TV-related Christmas gift I’ve ever received. And when the other ghosts find out? Oh baby, this will be the gift that keeps on giving well into 2023.
Ghouls Just Want to Have Fun
• When Trevor tells Sam he’s hurt that she’d try to fix Bela up with Eric right in front of him, she has the perfect response: “Sorry, it’s just that he seems like a nice guy and you don’t have a body.”
• Sam giving the ghosts gifts is honestly the sweetest. She gives Sas a frozen pizza to smell! Has anyone ever been so happy on Christmas morning?
• To get the conversation to focus on him, at one point, Isaac stage whispers, “Somebody ask me if I’m okay.” It’s actually a pretty great move.
• “You’re my sister and it’s Christmas, so let’s get a ghost in this dude, huh?”
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()}});
}, {"1":1,"6":6,"12":12,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(12),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(1),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 o=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||o.classList.remove("open")})}function gtmSendReport(e,n,t){let o={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(o.eventLabel=n.href),gtm.reportNow(o)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const o=t.split("?"),i=new URLSearchParams(o[1]);for(let e of n.entries())i.set(e[0],e[1]);t=`${o[0]}?${i.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()&&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;
}, {"1":1,"4":4,"12":12,"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();
// ]]