Property 'data' does not exist on type 'Object' on ng build --prod.
My service.ts
getSlogan() {
return this.http.get(this._slogan)
}
My component.ts
import ...
.
.
export interface Iheader {
facebook_link: string
id: number
instagram_link: string
line_link: string
pinterest_link: string
site_slogan: string
tel: string
youtube_link: string
}
export class HeaderComponent implements OnInit {
socials : any
data : Iheader
ngOnInit() {
// get site data
this.apiservice.getSlogan()
.subscribe(data => {
this.socials = data
});
My html
<a target="_blank" [href]="socials?.data.pinterest_link">
It's error "Property 'data' does not exist on type 'Object'" on ng build --prod.
My api data look like
[
status: 200,
data: {
data: {
pinterest_link: "url"
}
}
]