Created
July 13, 2018 09:10
-
-
Save sokhomhuy/d12fd8c86680e8f48c546a468210e1a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ItemsComponent implements OnInit { | |
testing: Array<inventory>; | |
ngOnInit() { | |
this.testing = [ | |
new inventory({ | |
accountName: '', | |
accountCode: '', | |
items: [ | |
new item({ | |
itemCode: 'test', | |
itemName: 'testing', | |
}), | |
new item({ | |
itemCode: 'test1', | |
itemName: 'testing1', | |
}) | |
] | |
}), | |
new inventory({ | |
accountName: '1123', | |
accountCode: '1414', | |
items: [ | |
new item({ | |
itemCode: 'fe', | |
itemName: 'testi23ng', | |
}), | |
new item({ | |
itemCode: 'tes4t1', | |
itemName: 'testi42ng1', | |
}) | |
] | |
}) | |
]; | |
} | |
} | |
export class inventory{ | |
accountName: string; | |
accountCode: string; | |
items: Array<item>; | |
constructor(data?: inventory) { | |
if (data) { | |
for (var property in data) { | |
if (data.hasOwnProperty(property)) | |
(<any>this)[property] = (<any>data)[property]; | |
} | |
} | |
} | |
} | |
export class item { | |
itemName: string; | |
itemCode: string; | |
constructor(data?: item) { | |
if (data) { | |
for (var property in data) { | |
if (data.hasOwnProperty(property)) | |
(<any>this)[property] = (<any>data)[property]; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment