在ng prod标志

时间:2017-04-19 05:00:33

标签: angular typescript immutability

版本。

@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/cli: 1.0.0
@angular/compiler-cli: 2.4.7
node: 6.9.5
os: win32 x64

以下代码是在简单构建时编译的,但是当我尝试使用--prod标志进行编译时,它只是开始抛出错误。

//customerRecord.ts
import { List, Record } from 'immutable';
const CustomerRecord = Record({
    id: 0,
    name: '',
    email: '',
    customer_meta: {
        _address: '',
        _secondary_email: '',
        _phone: '',
        _cell: '',
        qb_id: '',
    }
});
 //customer.ts
import { CustomerRecord } from "./customerRecord";
export class Customer extends CustomerRecord {
   id: number;
    name: string;
    email: string;
    customer_meta: {
        _address: string;
        _secondary_email: string;
        _phone: any;
        _cell: any;
        qb_id: any;
    };
    constructor(props) {
        super(props);
    }
}

失败给出的日志。

ERROR in Error encountered resolving symbol values statically. Calling 
function 'Record', function calls are not supported
. Consider replacing the function or lambda with a reference to an exported function, resolving symbol CustomerRecord in C
:/xampp/htdocs/mybuilderpro-angular/src/app/customer/customerRecord.ts, resolving symbol Customer in C:/xampp/htdocs/mybui
lderpro-angular/src/app/customer/customer.ts

Here's how facebook immutable Record works

0 个答案:

没有答案