I'm trying to build a constructor function with the Google Closure library.
To do so, I have a closure that return a factory method that export the constructor:
(function(factory) {
namespace.ui.Modal = factory();
})(function() {
var Modal = function() {};
goog.inherits(Modal, namespace.ui.Base);
return Modal;
});
This fails the build with the closure compiler. How could I annotate this code so it works as is inside closure compiler?
The standard pattern for a constructor would be:
/**
* @constructor
*/
namespace.ui.Modal = function() {
/** @private {string} */
this.field = "oh no, not hello again";
}
goog.inherits(namespace.ui.Modal, namespace.ui.Base);
Hope this helps
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.