angularjs - JSON from REST service returning under wrong name -


i building angularjs/typescript web app netbeans restful backend. have typescript interface set vendor follows:

interface vendor {     vendorno: number,     name: string,     address1: string,     city: string,     province: string,     postalcode: string,     phone: string,     vendortype: string,     email: string; } 

when call rest service pull of vendors javadb pulling json named under different scheme interface, , in order angular directives work, have reference naming scheme of json instead , causing things break:

[{"vendoraddress":"543 sycamore ave","vendorcity":"toronto","vendoremail":"bb@depot.ca","vendorname":"big bills depot","vendorno":1,"vendorphone":"(999) 555-5555","vendorpostalcode":"n1p1n5","vendorprovince":"on","vendortype":"trusted"}, {"vendoraddress":"628 richmond street","vendorcity":"london","vendoremail":"abc@supply.ca","vendorname":"abc supply co.","vendorno":2,"vendorphone":"(519) 123-4567","vendorpostalcode":"n6c1l7","vendorprovince":"on","vendortype":"trusted"}, {"vendoraddress":"123 main boulevard","vendorcity":"burlington","vendoremail":"gs@shack.net","vendorname":"gadget shack","vendorno":3,"vendorphone":"(613) 444-3423","vendorpostalcode":"n3x5s2","vendorprovince":"on","vendortype":"unknown"}] 

in order display vendor data in table on partial have use following angular bindings:

<div class="col-lg-1 col-sm-1 col-xs-1 text-left">{{vend.vendorno}}</div> <div class="col-lg-4 col-sm-4 col-xs-4 text-center">{{vend.vendorname}}</div> <div class="col-lg-3 col-sm-3 col-xs-3 text-center">{{vend.vendorcity}}</div> <div class="col-lg-3 col-sm-3 col-xs-3 text-center">{{vend.vendortype}}</div> 

is there reason either angularjs or java rest service auto renaming returned json have these property names?

is there reason either angularjs or java rest service auto renaming returned json have these property names

it isn't angular. java rest service.

one option update interface match server returns :

interface vendor {     vendorno: number;     vendorname: string;     // on ... } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -