HTML:
<map street="{{firstunit.street}}"/>
Component:
@Component('CustomerService', {
templateUrl: '/CustomerService/_UnitCard/MapComponent/Map.html',
selector: 'map',
bindings: {
street: '@',
}
})
export class MapComponent {
private x: string;
public $onInit() {
this.x = 'y';
}
public getValue() {
console.log(this.x);
}
}
In my class, I initialize a value using $onInit but encounter an issue after calling another function where it logs 'undefined'. How can I ensure that the class property is correctly set using $onInit? (utilizing angular 1.7 with typescript).