fix: merge index.html

This commit is contained in:
Zhicheng Wang 2018-03-26 16:10:05 +08:00
parent 42b585cc9f
commit e4a1c19093
2 changed files with 24 additions and 1 deletions

View File

@ -1,4 +1,4 @@
// This is for the production site, which is hosted at https://angular.io
// This is for the production site, which is hosted at https://angular.cn
export const environment = {
gaId: 'UA-80456300-1', // Production id
production: true,

View File

@ -109,6 +109,29 @@
xhr.send();
}
</script>
<script>
//load CE polyfill
//HACK: webpack's html plugin mangles the document.write calls if we don't trick it.
//load the ES5 shim for browsers with native CE support
function loadCustomElementsShim(){
document.write('<scri' + 'pt src="assets/js/native-shim.js"><' + '/script>');
}
//load the full custom elements polyfill for browsers without support
function loadCustomElementsPolyfill(){
document.write('<scri' + 'pt src="assets/js/custom-elements.min.js"><' + '/script>');
}
//detect if we have native CE support
if(!window.customElements){
loadCustomElementsPolyfill();
}
else {
loadCustomElementsShim();
}
</script>
</head>
<body>