Skip to content

Instantly share code, notes, and snippets.

@betocantu93
Created September 17, 2020 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save betocantu93/60ad0dbd18536720112466ca65fc9262 to your computer and use it in GitHub Desktop.
Save betocantu93/60ad0dbd18536720112466ca65fc9262 to your computer and use it in GitHub Desktop.
Clean the dom when ember root view is ready
export function initialize(appInstance) {
if (typeof FastBoot === 'undefined') {
let originalDidCreateRootView = appInstance.didCreateRootView;
appInstance.didCreateRootView = function() {
let elements = document.querySelectorAll(appInstance.rootElement + ' #app-shell');
for (let i = 0; i < elements.length; i++) {
let element = elements[i];
element.parentNode.removeChild(element);
}
originalDidCreateRootView.apply(appInstance, arguments);
};
}
}
export default {
initialize
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment