Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs Can';t运行角度应用程序_Angularjs - Fatal编程技术网

Angularjs Can';t运行角度应用程序

Angularjs Can';t运行角度应用程序,angularjs,Angularjs,我正在尝试运行angularjs页面。我只创建了一个控制器,但它不工作 我已尽可能减少代码以发现问题,但我找不到,只有两个文件: index.html <html np-app> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> <script src="main.js"&g

我正在尝试运行angularjs页面。我只创建了一个控制器,但它不工作

我已尽可能减少代码以发现问题,但我找不到,只有两个文件:

index.html

<html np-app>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
    <script src="main.js"></script>
  </head>
  <body ng-controller="RunmeCtrl">{{hi}}</body>
</html>
控制台只记录加载的
脚本
,但没有调用控制器,我不知道为什么。 该页面在浏览器中显示“{hi}”。没有显示错误

有什么想法吗

更新:

Angularjs加载正确,因为我可以在javascript控制台上找到
angular
对象:

> angular
Object {element: function, bootstrap: function, copy: function, extend: function, equals: function…}

看起来您需要将
np-app
切换到
ng-app
:)

看起来您需要将
np-app
切换到
ng-app
:)

可能是np应用程序而不是ng应用程序吗?哈哈,杀了我。你说得对,谢谢@Lukas:)Stackoverflow不允许我这么快接受答案,我会在10分钟内接受,谢谢这个问题似乎离题了,因为它是关于typo@Stewie这是真的,我能做点什么吗?可能是
np应用程序
而不是
ng应用程序
?哈哈,杀了我。你说得对,谢谢@Lukas:)Stackoverflow不允许我这么快接受答案,我会在10分钟内接受,谢谢这个问题似乎离题了,因为它是关于typo@Stewie这是真的,我能做点什么吗?
> angular
Object {element: function, bootstrap: function, copy: function, extend: function, equals: function…}