打包前代码:
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
// var Parent = require('../../../../js/controller/Parent.js');
var Base = (function (_super) {
__extends(Base, _super);
function Base() {
_super.apply(this, arguments);
console.log('子类');
}
return Base;
}(Parent));
angular.module('ViewApp')
.controller('Base', Base.constArg(Base));
module.exports = Base;
打包后代码:
....省略了开头的部分
/*/ (function(module, exports) {
/**
@fileoverview event log controller
@author zhaok.jy
@event_at 2016/11/24
**/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Parent = require('../../../../js/controller/Parent.js');
var Base = (function (_super) {
__extends(Base, _super);
function Base() {
_super.apply(this, arguments);
console.log('子类');
}
return Base;
}(Parent));
angular.module('ViewApp')
.controller('Base', Base.constArg(Base));
module.exports = Base;
/*/ })
// ]);
注:constArg方法在父类中存在。
打包后运行总是报Base.constArg找不到。
打包之前要将相互依赖的文件导入导出。