Skip to content

Instantly share code, notes, and snippets.

@wastemobile
Last active December 27, 2015 04:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wastemobile/7268456 to your computer and use it in GitHub Desktop.
Save wastemobile/7268456 to your computer and use it in GitHub Desktop.
據說 AngularJS 頁面若是被 IE8 以下的瀏覽器摸到,因為對 JSON 支援不足的緣故,會整個 View Template 直接秀出來,必須改用下面的寫法。IE 果真是網路的殺手啊~
<html ng-app id="ng-app" class="ng-app">
<head runat="server">
<title></title>
<!--[if lte IE 8]>
<script src="http://cdnjs.cloudflare.com/ajax/libs/json3/3.2.5/json3.min.js"></script>
<![endif]-->
<script src="Scripts/angular.min.js" type="text/javascript"></script>
<style type="text/css">
table,table td{border:1px solid gray}
</style>
</head>
<body >
<form id="form1" runat="server">
<div ng-init="friends = [{ name: 'John', age: 25 }, { name: 'Mary', age: 28}]">有{{friends.length}}筆資料</div>
<br />
<table >
<tr ng-repeat="friend in friends">
<td>{{friend.name}}</td><td>{{friend.age}}</td>
</tr>
</table>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment