AngularJS' ng:areq 错误参数“{controller} 不是函数”,在 CodeIgniter 上带有 textAngular

AngularJS' ng:areq Bad Argument "{controller} is not a function", with textAngular on CodeIgniter

我正在尝试在 CodeIgniter 视图中实现带有文本 Angular 的文本编辑器,但它一直返回此错误:

angular.js:13424 Error: [ng:areq] Argument 'wysiwygeditor' is not a function, got undefined
http://errors.angularjs.org/1.5.3/ng/areq?p0=wysiwygeditor&p1=not%20a%20function%2C%20got%20undefined

其中 'wysiwygeditor' 是 ng-controller 上的名称。

我发现了数十个问题,而且似乎都是由相同的错误引起的:

None 恰好是问题所在,我只是复制已经可以运行的代码。它是 textAngular-1.5.0. I copy the code to a CodeIgniter view, include all the required 库中的 demo.html,但仍然出现错误。然后我注意到每当我用 Angular JS.

声明一个控制器时它就会发生

举个更好的例子:

<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js'></script>
<div ng-app="myApp">
    <div ng-controller="GreetingController">
        {{greeting}}
    </div>
</div>
<script>
    var myApp = angular.module('myApp',[]);

    myApp.controller('GreetingController', ['$scope', function($scope) {
      $scope.greeting = 'Bom dia!';
    }]);
</script>

此代码在 CodeIgniter 上给出了该错误,但如果我将其放入一个简单的 html 文件中,则可以正常工作。

这是您编辑的工作代码... 不要使用编辑器,这会浪费你的时间,它们大部分都不起作用,有时它会起作用...

<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js"></script>
<body>

<div ng-app="myApp" >
<div ng-controller="GreetingController">
{{greeting}}
</div>
</div>

<script>
var app = angular.module('myApp', []);
app.controller('GreetingController', function($scope) {
    $scope.greeting= "John";

});
</script>

</body>
</html>

我的错,我的项目在我忘记存在的模板文件中的父元素上声明了 ng-app。删除了这个标签,AngularJS 停止返回那个错误。