How can I create an object based on an interface file definition in TypeScript?

后端 未结 11 1398
[愿得一人]
[愿得一人] 2020-12-04 05:01

I have defined an interface like this:

interface IModal {
    content: string;
    form: string;
    href: string;
    $form: JQuery;
    $message: JQuery;
          


        
11条回答
  •  -上瘾入骨i
    2020-12-04 05:46

    Since I haven't found an equal answer in the top and my answer is different. I do:

    modal: IModal = {}
    

提交回复
热议问题