TypeScript-'s Angular Framework Error - “There is no directive with exportAs set to ngForm”

前端 未结 22 1745
轻奢々
轻奢々 2020-12-04 09:18

I keep getting this error while using TypeScript\'s Angular2-forms framework:

There is no directive with \"exportAs\" set to \"ngForm

22条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 09:49

    I had the same issue and solved it by updating all dependencies (package.json) with the following command npm update -D && npm update -S

    As @Günter Zöchbauer pointed out, make sure to include the FormsModule first.

提交回复
热议问题