fix: merge index.html
This commit is contained in:
parent
42b585cc9f
commit
e4a1c19093
|
@ -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,
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue