为什么我的web应用程序无法识别angular.js [英] why my web application can't recognize angular.js

查看:141
本文介绍了为什么我的web应用程序无法识别angular.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在角初学者,我试图加载并使用它在我的web应用程序(VS),但每一次我得到的问题认识角度和我不知道为什么......我尝试不同的东西,但都具有相同的输出 - 不承认角

I am a beginner in angular, I am trying to load and use it in my web application (VS) but each time I get problems with recognizing angular and I dont know why...I tried different things but all have the same output - not recognizing angular


  1. 我下载从网站的角度和angular.min.js添加链接,这从我的网页的js文件夹

  1. I download angular.min.js from angular website and add link to this js folder from my page

尝试<脚本的src =脚本/ angular.js>< / SCRIPT> 没有改变...

使用软件包管理器控制台尝试:; PM&GT<安装封装angularjs 成功添加...

tried using package manager console : <PM> Install-Package angularjs added successfully...

下面是从我的HTML页面的完整code ...

here is a full code from my HTML page...

<html xmlns="http://www.w3.org/1999/xhtml" data-ng-app="test">
<head runat="server">
    <script src="Scripts/angular.min.js"></script>
    <script src="Scripts/app.js"></script>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    </div>
    </form>
</body>
</html>

// app.js

//app.js

 (function () {

        var app = angular.module('test',[]);

    });

*更新:我得到这个错误:

*UPDATE: I get this error :

Unhandled exception at line 7, column 218 in http://localhost:4191/Scripts/angular.min.js

0x800a138f - JavaScript runtime error: Object expected

解决方案:我用angular.min.js - 它改变SRC =htt​​ps://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js。问题解决了。

推荐答案

据对<一的评论href=\"http://stackoverflow.com/questions/29749970/angular-js-script5007-object-expected-error-in-ie9-and-ie10-upon-loading-the\">this SO 页面问题需要以下加价

According to the comments on this SO question the page needs the following mark-up

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

这篇关于为什么我的web应用程序无法识别angular.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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