Answer the question
In order to leave comments, you need to log in
How to share an instance among the entire Angular application?
The root component <app-root>
has an input property `@Input() props`.
In the component's constructor, this property is read and the third-party map (class) is initialized:
export class MapComponent implements AfterContentInit {
public map: Map;
@Input() props: MapProps = {};
constructor() {
this.map = new Map(this.props)
}
}
this.map = new Map()
among the entire Angular application?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question