Answer the question
In order to leave comments, you need to log in
One custom class instance in Angular 2?
I have a custom class like this:
export class SingletonClassRegister {
public registeredClasses: ClassItem = {};
public getClass(obj: any) {
this.registeredClasses['name'] = obj;
}
}
providers: [SingletonClassRegister]
constructor(
private singletonClassRegister: SingletonClassRegister) {}
this. singletonClassRegister.getClass(new Object());
console.log(this.singletonClassRegister.registeredClasses);
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