I need to develop a page with AngularJS.
I have two tables.
Table 1 : StateList
StateCode | StateName
-------------------------------
AZ | ARIZONA
CA | CALIFORNIA
NY | NEW YORK
Table 2: CustomerDetail
Name | BornState | LivingState
-----------------------------------------
Peter | AZ | NY
Bob | CA | AZ
Want to display list like this on HTML Page.
Customer Name | Customer BornState | Customer LivingState
------------------------------------------------------------------------
Peter | ARIZONA | New York
Bob | CALIFORNIA | ARIZONA
Instead of state code, I want to display State Name for each type of state information, e.g BornState and LivingState. I am able to fetch list from Table 2:CustomerDetail but how I can convert state code with state name for each type of state information?
Thanks in advance
Adding more Details
I have $stateProvider as below
.state("customerDetail",{
url:"/customer/detail/:customerId",
templateUrl:"app/customer/customerDetail.html",
controller: "DetailCtrl as vm",
resolve: {
customer: function (Restangular, $stateParams) {
return Restangular.one('customer', $stateParams.customerId).get();
}
}
})
This give me array like
{"customerId":"1","customerName":"Bob","BornState":"CA","LivingState":"AZ"}
my state array list is like
[{"Code":"NY","Name":"New York"},{"Code":"AZ","Name":"ARIZONA"},{"Code":"CA","Name":"CALIFORNIA"}]
I want to display full state name instead of state code