在Angular 2中使用Angular 1库吗? [英] Using Angular 1 libraries in Angular 2?
问题描述
我可以使用Angular库,例如Angular 2应用程序中的angular-cookies吗? 看来这是不可能的,但是我想知道这个原因,因为我打算将项目升级到Angular2
Can I use Angular libraries, for example angular-cookies in Angular 2 app? Seems that this is not possible, but I want to know this cause I'm planning to upgrade project to Angular2
推荐答案
通常,不会.如果您有兴趣通过运行Angular 1和迁移指南来遵循同时使用2,您可能可以使Angular 1库正常运行,但这可能不值得您麻烦.
In general, no. If you're interested in following the migration guide by running Angular 1 and 2 simultaneously, you may be able to get an Angular 1 library functioning, but it's likely not worth your trouble.
我鼓励您不要害怕自己重写通用库.如此简单,您会感到惊讶-在许多情况下,您将花费更多的时间来查找库的文档,并且对代码有深入的了解.
I'd encourage you not to be scared of rewriting common libraries for yourself. You'll be surprised by how easy it is - in many instances you'd spend more time trying to figure out a library's documentation, and you gain an intimate understanding of the code.
这篇关于在Angular 2中使用Angular 1库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!