I was having this problem rendering, more design elements dynamically using javascript CDM (eg menu) it was not rendered correctly. I created a solution to run componentHandler.upgradeDom () only when a new element is added:
var app = angular.module('app');
app.run(function () {
var mdlUpgradeDom = false;
setInterval(function() {
if (mdlUpgradeDom) {
componentHandler.upgradeDom();
mdlUpgradeDom = false;
}
}, 200);
var observer = new MutationObserver(function () {
mdlUpgradeDom = true;
});
observer.observe(document.body, {
childList: true,
subtree: true
});
/* support <= IE 10
angular.element(document).bind('DOMNodeInserted', function(e) {
mdlUpgradeDom = true;
});
*/
});
Problem solved!