Skip to content

Proposal: Drop @View decorator #7363

Closed
Closed

Description

@tbosch

Initially we thought that we want to support multiple templates per component, switching between them based on the the device the application is running.

But:

  • we never implemented this switching, as it needs to be done during compilation already
  • switching views is probably not enough, as different environments use different libraries, i.e. different import statements that are mutually exclusive.

Activity

  1. marclaval commented on Mar 2, 2016

    @marclaval
    Contributor

    For me, there is a need to be able to build one application for various platforms or renderers.
    The switch should be doable:

    • at compilation time for a specific target, e.g. mobile web or iOS with React Native
    • at run time to enable adaptive design

    I fully agree that @View is not enough, for example the router should be involved too.
    But it seemed that it would a good first step.

  2. jpleclerc commented on Mar 3, 2016

    @jpleclerc

    @Mlaval I am curious, why isn't a ngIf or ngSwitch enough to switch between templates?

  3. 0x-r4bbit commented on Mar 3, 2016

    @0x-r4bbit
    Contributor

    @jpleclerc you'd still ship both templates which can be a problem on mobile.

    @tbosch is there at least an alternative?

  4. tbosch commented on Mar 3, 2016

    @tbosch
    ContributorAuthor

    We have to think about this problem more.
    However, as we are currently not supporting multiple @view decorators we
    should drop it.

    We might add something similar later when we know exactly how this should
    work...
    On Thu, Mar 3, 2016 at 6:31 AM Pascal Precht notifications@github.com
    wrote:

    @jpleclerc https://github.com/jpleclerc you'd still ship both templates
    which can be a problem on mobile.

    @tbosch https://github.com/tbosch is there at least an alternative?

    —
    Reply to this email directly or view it on GitHub
    #7363 (comment).

  5. lacolaco commented on Mar 3, 2016

    @lacolaco
    Contributor

    ViewMetadata will be dropped too?

  6. mhevery commented on Mar 17, 2016

    @mhevery
    Contributor
  7. ericmartinezr commented on Mar 19, 2016

    @ericmartinezr
    Contributor

    @laco0416 I think it should be removed as well, see this piece of code https://github.com/angular/angular/blob/master/modules/angular2/src/core/linker/view_resolver.ts#L97-L101 , the error message keeps referencing @View.

  8. mhevery commented on Mar 22, 2016

    @mhevery
    Contributor
  9. chrisnicola commented on Mar 22, 2016

    @chrisnicola

    @PascalPrecht @Mlaval this seems to me like it would very solve-able at build with a tool like webpack.

  10. pkozlowski-opensource commented on Jun 15, 2016

    @pkozlowski-opensource
    Member

    @View was dropped long time ago so closing this one. We will need to think about multiple templates per component in the future but this is whole different issue.

  11. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  12. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions