工具包
我正在尝试记录我的课程,但我使用“self”var 仅公开公共方法。
jsDoc可以找到类名,但是找不到方法、字段、属性等...
这是我的一门课:
有什么建议我应该如何解决这个问题?
(function(App){
/** @class The ViewModel for the EventView */
App.ViewModels.EventsViewModel = function(service) {
var self = {};
/** Observable array containing events */
self.events = new ko.observableArray();
/** Call the fetchEvents method on the service */
self.refreshEvents = function(e){
$('.refreshBtn').changeIcon('refreshing');
service.fetchEvents();
}
/** subscribe on the service->currentEvents var
* on change update the events in this viewmodel
* set the refesh butting is set to refresh (instead of refreashing) */
service.currentEvents.subscribe(
function(newValue){
self.events(newValue);
$('.refreshBtn').changeIcon('refresh');
}
);
/** function for a timespan string ex: "10:00 - 14:00"
* Date inputs should be of ISO-8601 Date format */
self.toTimeString= function(/* String */ start,/* String */ end)/* String */
{
var out = "";
try
{
out =(start!=null && end!=null)? Util.IsoDateParse(start).format("HH:MM") + " - " + Util.IsoDateParse(end).format("HH:MM") : ""
}
catch(err)
{
out ="Error during toTimeString.\n\n";
out+="Error description: " + err + "\n\n";
}
return out;
}
/** Call the fetchEvents method on the service */
self.refreshEvents();
return self;
};
})(App)
ps:我正在使用 Knockoutjs 和 jQueryMobile
编辑:
谢谢!快到了......我试着做这样的事情:
/** @memberOf App.ViewModels.EventsViewModel#
* @field * @description Observable array containing events */
self.events = new ko.observableArray();
jsDoc 将其显示为“self.events”而不是“events”