角路由不能在IE7工作 [英] Angular Routing not working in IE7

查看:148
本文介绍了角路由不能在IE7工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已教程按照我的应用程序在执行路由

I have been implementing Routing in my app following the tutorial

http://docs.angularjs.org/tutorial/step_07

我不能让我的版本在IE7中工作,而花费在试图找出什么我错过了/做错了什么我已经注意到,例如不工作了。

I couldn't get my version to work in IE7, and after spending a while trying to work out what I have missed / done wrong I have noticed that the example doesn't work.

<一个href=\"http://angular.github.com/angular-phonecat/step-7/app/\">http://angular.github.com/angular-phonecat/step-7/app/

任何人知道如何得到这个工作?

Anyone know how to get this to work?

推荐答案

确定我有同样的问题,所以我开始赏金,但在那之后,我发现工作液(至少对我来说):

OK I had the same problem so I started the bounty, but after that I found the working solution (for me at least):


  • 使用HTML5垫片

  • 使用JSON2.js

  • 所有这些属性添加到您的HTML节点:

  • Use HTML5 shim
  • Use JSON2.js
  • Add all these attributes to your html node:

类=NG-应用:MyApp的ID =NG-应用NG-应用程序=的myapp的xmlns:NG =htt​​p://angularjs.org

class="ng-app:myapp" id="ng-app" ng-app="myapp" xmlns:ng="http://angularjs.org"

(其中的的myapp <​​/ em>的确实是你的应用程序名称)

(where myapp is really your app name)

因此​​,要回顾一下,这是我的IE7 / 8/9个工作HTML页:

So to recap, here is my IE7/8/9 working HTML page:

<!DOCTYPE html>
<html lang="en" class="ng-app:myapp" id="ng-app" ng-app="myapp" xmlns:ng="http://angularjs.org">
  <head>
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <!--[if lte IE 8]>
      <script>
        document.createElement('ng-include');
        document.createElement('ng-pluralize');
        document.createElement('ng-view');
        document.createElement('ng:include');
        document.createElement('ng:pluralize');
        document.createElement('ng:view');
      </script>
    <![endif]-->
    <!--[if lt IE 8]>
      <script src="js/json2.js"></script>
    <![endif]-->
  </head>
  <body>
    <div ng-view></div>
  </body>
</html>

这篇关于角路由不能在IE7工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆