Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.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
Javascript 为什么我会得到;错误:[ng:areq]http://errors.angularjs.org/1.3.5/ng/areq?p0=GreetingController&p1=不是%20a%20函数%2C%20得到%20未定义”; var myApp=angular.module('myApp',[]); myApp.controller('GreetingController',['$scope',函数($scope){ $scope.greeting='Hola!'; }]); {{1+2}} {{问候语}_Javascript_Angularjs - Fatal编程技术网

Javascript 为什么我会得到;错误:[ng:areq]http://errors.angularjs.org/1.3.5/ng/areq?p0=GreetingController&p1=不是%20a%20函数%2C%20得到%20未定义”; var myApp=angular.module('myApp',[]); myApp.controller('GreetingController',['$scope',函数($scope){ $scope.greeting='Hola!'; }]); {{1+2}} {{问候语}

Javascript 为什么我会得到;错误:[ng:areq]http://errors.angularjs.org/1.3.5/ng/areq?p0=GreetingController&p1=不是%20a%20函数%2C%20得到%20未定义”; var myApp=angular.module('myApp',[]); myApp.controller('GreetingController',['$scope',函数($scope){ $scope.greeting='Hola!'; }]); {{1+2}} {{问候语},javascript,angularjs,Javascript,Angularjs,你能给我解释一下为什么它会给我 错误:[ng:areq]您需要添加ng app=“myApp” 有关ngApp指令的更多信息您可能的副本丢失ng app=“myApp” <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"></script> <script src="http://angular-ui.github.io/bootstrap/ui-boot

你能给我解释一下为什么它会给我
错误:[ng:areq]

您需要添加
ng app=“myApp”

有关ngApp指令的更多信息

您可能的副本丢失
ng app=“myApp”
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.3.0.min.js"></script>


<html>
    <script>
        var myApp = angular.module('myApp', []);

        myApp.controller('GreetingController', ['$scope', function ($scope) {
            $scope.greeting = 'Hola!';
        }]);

    </script>

    <body ng-app>
        {{1+2}}
        <div ng-controller="GreetingController">
            {{ greeting }}
        </div>
</body>
</html>