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 角度文档控制器_Javascript_Angularjs_Jsdoc - Fatal编程技术网

Javascript 角度文档控制器

Javascript 角度文档控制器,javascript,angularjs,jsdoc,Javascript,Angularjs,Jsdoc,所以我现在正在分割我的文件;控制器、服务和指令等。我有如下内容 /** * @ngdoc overview * @name application * @description * Main app controller. */ angular.module('application') /** * @ngdoc object * @name application.AppCtrl * @requires $scope * @descr

所以我现在正在分割我的文件;控制器、服务和指令等。我有如下内容

/**
 * @ngdoc overview
 * @name application
 * @description
 * Main app controller.
 */
angular.module('application')
    /**
     * @ngdoc object
     * @name application.AppCtrl
     * @requires  $scope
     * @description
     * Hello App controller
     */
    .controller('AppCtrl', function ($scope) {
        $scope.message = 'Hello from AppCtrl';
        $scope.updateMessage = function (msg) {
            $scope.message = msg;
        };
    });
生成的内容看起来非常好,但是,概述部分(应用程序)似乎不知道或链接到应用程序。AppCtrl是否可能/如何


感谢

,因为您在尝试检索模块应用程序时(在您提供的示例中)缺少
[]
之后的
[
。将数组作为第二个参数传递将创建模块,而只传递模块名而不传递数组将检索模块

/**
     * @ngdoc overview
     * @name application
     * @description
     * Main app controller.
     */
    angular.module('application',[])//pass an array as the second parameter
        /**
         * @ngdoc object
         * @name application.AppCtrl
         * @requires  $scope
         * @description
         * Hello App controller
         */
        .controller('AppCtrl', function ($scope) {
            $scope.message = 'Hello from AppCtrl';
            $scope.updateMessage = function (msg) {
                $scope.message = msg;
            };
        });