nil*_*ltz 11 angularjs gruntjs
我有一些带有一些文档的服务,但是当我尝试使用grunt-ngdocs构建文档时,它失败了:
Warning: Don't know how to format @ngdoc: method Use --force to continue.
Run Code Online (Sandbox Code Playgroud)
这是我想要做的
(function(angular) {
'use strict';
angular.module('services.base64', [])
.factory(
'Base64',
[function() {
/**
* @ngdoc service
* @name Base64
* @module services.base64
* @description Provides encoding a string into base64, and decode base64 to a string
*/
return {
/**
* @ngdoc method
* @name Base64#encode
* @param {string}
* input the string you want to encode as base64
* @returns {string} the base64 encoded string
*/
encode : function(input) {
//...
},
/**
* @ngdoc method
* @name Base64#decode
* @param {string}
* input the base64 encoded string
* @returns {string} the decoded string
*/
decode : function(input) {
//...
}
};
}]);
}(angular));
Run Code Online (Sandbox Code Playgroud)
我确定我错过了一些简单的东西......
nil*_*ltz 11
这就是我最终做的事情
(function(angular) {
'use strict';
/**
* @ngdoc overview
* @name services.base64
*/
angular.module('services.base64', [])
.factory(
'Base64',
[function() {
/**
* @ngdoc service
* @name services.base64.Base64
* @description Provides encoding a string into base64, and decode base64 to a string
*/
return {
/**
* @ngdoc method
* @name encode
* @methodOf services.base64.Base64
* @param {string}
* input the string you want to encode as base64
* @returns {string} the base64 encoded string
*/
encode : function(input) {
//...
},
/**
* @ngdoc method
* @name decode
* @methodOf services.base64.Base64
* @param {string}
* input the base64 encoded string
* @returns {string} the decoded string
*/
decode : function(input) {
//...
}
};
}]);
}(angular));
Run Code Online (Sandbox Code Playgroud)
这看起来像我想要的那样......也许有一种不那么冗长的做法呢?
| 归档时间: |
|
| 查看次数: |
7665 次 |
| 最近记录: |