-
Notifications
You must be signed in to change notification settings - Fork 216
/
Copy path_index.html
82 lines (81 loc) · 3 KB
/
_index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<% if (props.target.includes('web')) { -%>
<!-- needs to be right at the top to prevent Chrome from reloading favicon on every route change -->
<link rel="icon" type="image/x-icon" href="favicon.ico"/>
<% } -%>
<title><%= props.appName %></title>
<base href="/"/>
<% if (props.target.includes('cordova')) { -%>
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="msapplication-tap-highlight" content="no"/>
<% } else { -%>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<% } -%>
<% if (props.target.includes('cordova') || props.pwa) { -%>
<meta name="theme-color" content="#4e8ef7"/>
<% } -%>
<% if (props.pwa) { -%>
<link rel="manifest" href="manifest.webmanifest"/>
<% } -%>
<% if (props.target.includes('web')) { -%>
<!-- add to homescreen for ios -->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="default"/>
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png"/>
<% } -%>
</head>
<body>
<% if (props.angulartics && props.analyticsProvider === 'ga') { -%>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '<%= props.googleAnalyticsAccount %>', 'auto');
</script>
<!-- End Google Analytics -->
<% } -%>
<% if (props.target.includes('web')) { -%>
<!--[if lte IE 11]>
<p>
You are using an <strong>outdated</strong> browser.
Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.
</p>
<![endif]-->
<noscript>
<p>
This page requires JavaScript to work properly. Please enable JavaScript in your browser.
</p>
</noscript>
<% } -%>
<% if (props.target.includes('cordova')) { -%>
<!-- Include Cordova script only when needed -->
<script>
if (/^app/.test(location.host)) {
/**
* https://github.com/angular/angular/issues/22509
* Prevent cordova.js 5.2.4+ routing bug
**/
window.addEventListener = function () {
EventTarget.prototype.addEventListener.apply(this, arguments);
};
window.removeEventListener = function () {
EventTarget.prototype.removeEventListener.apply(this, arguments);
};
document.addEventListener = function () {
EventTarget.prototype.addEventListener.apply(this, arguments);
};
document.removeEventListener = function () {
EventTarget.prototype.removeEventListener.apply(this, arguments);
};
document.write('<script src="cordova.js"><\/script>');
}
</script>
<% } -%>
<app-root></app-root>
</body>
</html>