Circular dependency caused by importing typescript type

前端 未结 4 571
借酒劲吻你
借酒劲吻你 2020-12-20 23:40

I\'m modeling data in typescript sent from a server to my Angular app. An Opportunity has a forms property containing an array of Form[]

4条回答
  •  天命终不由人
    2020-12-21 00:09

    Another approach is to use require instead of import in one class.
    Looks something like:

    let LoginPage = require("./loginpage").default;
    return new LoginPage();
    

    You can find it in the Best Practice #5 from this post.

提交回复
热议问题