本文介绍了装饰器@page,@ component和@app在离子2应用程序中意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过 @app @page @component 看似可以互换使用,我不知道有什么区别。

I've seen @app and @page and @component used seemingly interchangeably and i don't know what the difference is.

离子2文档在这方面非常糟糕,因此离子2应用程序的这些装饰器之间的根本区别是什么?何时使用其中一个?

The ionic2 documentation is very bad on this so what is the fundamental difference between these decorators for ionic 2 apps, and when would you use one over the other?

推荐答案

@Page和@App是不推荐的装饰者,你必须只关注@Component

@Page and @App are deprecated decorators you must focus only on @Component

angular2使用一种名为ReflectMetadata的东西,基本上是装饰器为你的类添加一些重要的元数据

angular2 use something called ReflectMetadata, basically a decorator add some important metadata to your class

这篇关于装饰器@page,@ component和@app在离子2应用程序中意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 18:00