在IE8角查看/路由 [英] Angular Views/Routes in IE8

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

问题描述

我跟着这个文件: http://docs.angularjs.org/guide/ie

但我仍没有看到IE8的意见。它的工作原理在现代浏览器的罚款。是否ngRoute帮助模块支持IE8?有什么建议?

But still I do not see the views in IE8. It works fine in modern browsers. Does ngRoute helper module support IE8? Any suggestions?

<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org" id="ng-app" ng-app="demoApp">
  <head>
    <!--[if lte IE 8]>
        <script src="//cdnjs.cloudflare.com/ajax/libs/json3/3.3.0/json3.min.js"></script>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<body> 
    <div class="container">
        Search by: 
        <span class="searchby"><a href="#/nameSearch">Name</a> | <a href="#/">Back</a></span>
        <div ng-view=""></div>
    </div>
    <script src="angular.min.js"></script>
    <script src="angular-route.min.js"></script>
    <script>
        var demoApp = angular.module("demoApp", ["ngRoute"]);
        demoApp.config(function ($routeProvider) {
            $routeProvider
                .when ('/',
                    {
                        templateUrl: "views/welcomePage.html",
                        controller: "SimpleController"
                    })
                .when ('/nameSearch',
                    {
                        templateUrl: "views/nameSearch.html",
                        controller: "SimpleController"
                    })
                .otherwise ({ redirectTo: '/' });
        })

        demoApp.controller("SimpleController", function ($scope) {
        })          
    </script>   
</body>

推荐答案

我想通了什么真正发生的事情。第一种观点是不是在IE8和IE9的显示。但意见工作。我换NG-路线为ui.router并添加以下的头,现在工作得很好。

I figured out what was really happening. The first view wasn't displaying in IE8 and IE9. But the views were working. I switched ng-route for ui.router and added the following to the header and it now works fine.

<meta http-equiv="X-UA-Compatible" content="IE=8">

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

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