Hi, @arunaraj
Add ionic Native Geocoder plugin in your app for get postal_code,
ionic cordova plugin add cordova-plugin-nativegeocoder
npm install --save @ionic-native/native-geocoder
Now, add this plugin in app.module file,
import { NativeGeocoder } from '@ionic-native/native-geocoder';
@NgModule({
......
providers: [
NativeGeocoder
]
......
})
export class AppModule {}
Now, you add this code in component file,
import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult } from '@ionic-native/native-geocoder';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(private nativeGeocoder: NativeGeocoder) { }
getPostalCode(){
this.nativeGeocoder.reverseGeocode(<latitude>, <longitude>)
.then((result: NativeGeocoderReverseResult) => console.log(JSON.stringify(result)))
.catch((error: any) => console.log(error));
}
}
Thanks.