Basit Basit - 7 months ago 39
Javascript Question

typescript + angular2 pass class from a string value

class SimpleComponent {


var string = 'SimpleComponent';

bootstrapComponents.push(string); // This should be 'SimpleComponent' class and not a string value.

How can I pass class object from a string value in typescript?


add the class name as a key

var classPointer={'SimpleComponent':SimpleComponent};