5

Now that the @Page decorator had been deprecated, how does the app differentiate between a component that should be used as part of a page and a component that represents a page you can navigate to?

The only difference I see that page components have no selector property defined in the @Component decorator.

Yaron Schwimmer
  • 5,327
  • 5
  • 36
  • 59
user1275105
  • 2,643
  • 5
  • 31
  • 45

1 Answers1

5

A component is considered to be a page if it's pushed to the navigation controller's stack.

A selector property is optional in an Angular2 component. You only need it when you want to use the component as an HTML element in the template of another component.

I think the reason @Page was deprecated, is that there wasn't so much difference between the two in the first place.

Yaron Schwimmer
  • 5,327
  • 5
  • 36
  • 59