12
A
回答
-1
您應該使用@ngdoc overview
作爲模塊定義。並且@ngdoc controller
用於控制器,@ngdoc service
用於服務。
模塊
/**
* @memberof dugun.leads
* @ngdoc module
* @description
* Leads mean info requsts and inbound calls
*/
angular.module('dugun.leads', [
// vendor
'ngRoute',
'dugun.notifications',
'dugun.queryString',
'dugun.search',
// app
'dugun.helpers.tableSort',
'dugun.forms',
'dugun.leads.infoRequests',
'dugun.leads.calls'
]);
路線
/**
* @memberof dugun.leads
* @ngdoc route
* @name LeadRoutes
* @param $routeProvider {provider} $routeProvider
*
* @description /providers/:providerId/info
*/
function LeadRoutes($routeProvider) {
$routeProvider
.when('/leads', {
templateUrl: 'leads/list.html',
controller: 'LeadListCtrl',
controllerAs: 'leadListCtrl',
label: 'Çiftler',
reloadOnSearch: false
});
}
控制器
/**
* Controls Provider
* @constructor
* @ngdoc object
* @memberof dugun.leads
* @name LeadListCtrl
* @scope
* @requires $scope {service} controller scope
* @requires $route {service} $route
* @requires $window {service} $window
* @requires $filter {service} $filter
* @requires dgNotifications {service} dgNotifications
* @requires moment {service} moment
* @requires queryString {service} dugun.queryString:queryString
* @requires Analytics
* @requires Leads {factory} Leads service
*/
function LeadListCtrl($scope, $route, $window, $filter,
dgNotifications, queryString, moment, Analytics,
Leads)
+4
我認爲問題在於,如何將ng-doc註釋添加到角度爲1.5.x的'.component()'中。我不確定我遵循你如何回答這個問題的答案?你能澄清一下嗎? – dhknudsen
0
據我所知,你不能解決的文components
與主版本ng-doc
。
Serenity-Frontstack取得了NG-doc和支持的叉角分量:
* @ngdoc component
* @name app.component:guideItem
*
* @description
* This component shows cards using the item binding for his own building.
*
* @param {object} item A object with card data
0
這裏有一個例子:
controller.js::
/**
* @this vm
* @ngdoc controller
* @name dragDropRelation.controller:draggableItemController
*
* @description
* Controller for the draggableItem component
*/
export default function draggableItemController() {
}
component.js:
import controller from './controller.js';
import templateUrl from './view.html';
/**
* @ngdoc component
* @name dragDropRelation.component:draggableItem
*
* @description
* Component that allows to be dragged containing some data.
* @param {Boolean} used Used flag
*
* @param {String} text Text to display
* @param {Object} data Data to be saved
*
* @param {Boolean} disabled variable to disable the component
*/
export const component = {
templateUrl: templateUrl,
controller: controller,
bindings: {
used: '<?',
text: '<',
data: '<',
disabled: '<?',
},
};
module.js:
import angular from 'angular';
import angularDragDrop from 'angular-drag-drop';
import {component} from './component.js';
/**
* @ngdoc overview
* @name dragDropRelation.module:draggableItem
*
* @description
* Module that contains the component draggableItem
*
* @example
* <b>script.js</b>
* <pre>
* import draggableItem from
* './components/drag-drop-relation/draggable-item/module'
* angular.module('myModule', [draggableItem]);
* </pre>
*
*/
export default angular
.module('draggableItem', [angularDragDrop])
.component('draggableItem', component)
.name;
這(使用一飲而盡-ngdocs)產生這樣的:
相關問題
- 1. 如何使用ngDoc註釋routeConfig
- 2. Spring註釋組件
- 3. Primefaces p:panelGrid cosider作爲組件的註釋
- 4. Hibernate註釋。如何註釋?
- 5. Angular 2 - 自定義註釋
- 6. 如何IE8條件註釋
- 7. 如何創建一組註釋的註釋?
- 8. angular 2 - 如何爲組件包含JavaScript?
- 9. 作爲javassist註釋成員的註釋數組
- 10. 如何在註釋中使用註釋?
- 11. 如何將元數據註釋轉換爲摘要註釋
- 12. 我將如何顯示註釋數組?
- 13. 如何在導出的React組件中註釋onChange事件?
- 14. 如何使用gulp在JavaScript文件中註釋註釋
- 15. Nativescript angular 2組件如何?
- 16. java註釋組成
- 17. SQL註釋分組
- 18. Angular - 服務注入動態組件?
- 19. Angular 1.5組件 - 依賴注入
- 20. 如何在Angular-Fullstack生成的Angular 1.5組件中注入依賴關係
- 21. 如何在ES5中將升級後的Angular 1 service/factory注入Angular 2組件?
- 22. 如何註銷Angular組件中的點擊監聽器?
- 23. Angular:如何使用appInject注入服務到組件中?
- 24. 如何註釋injector.getInstance?
- 25. 將單行註釋轉換爲註釋
- 26. 如何使用Angular注入cordovaHTTP插件
- 27. 如何將數組作爲註釋參數傳遞?
- 28. 你如何爲自定義類註釋?
- 29. 如何添加多個註釋爲iPhone
- 30. 條件註釋
只是澄清:你問的是當你用'.component()'編寫一個角度爲1.5.x的組件時,方法,對吧? – dhknudsen